源码编译安装 libiconv-1.14 报:./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function) [

转自:http://www.linuser.com/thread-1482-1-1.html


如题:配置编译参数通过,在进行 make 的时候报如下错误:

  1. In file included from progname.c:26:0:
  2. ./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function)
  3. _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
  4. ^
  5. make[2]: *** [progname.o] Error 1
  6. make[2]: Leaving directory `/usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib'
  7. make[1]: *** [all] Error 2
  8. make[1]: Leaving directory `/usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib'
  9. make: *** [all] Error 2
复制代码

解决方法:

使用 find 查找 stion.in.h 文件:
  1. [root@ip-172-31-29-70 libiconv-1.14]# find / -name 'stdio.in.h'
复制代码

编辑该文件
  1. [root@ip-172-31-29-70 libiconv-1.14]# vim /usr/local/src/zabbix-2.4.7/libiconv-1.14/srclib/stdio.in.h
复制代码
通过关键字 gets 找到698 行,将其和695行一同注释:
  1. 695 /* It is very rare that the developer ever has full control of stdin,
  2. 696    so any use of gets warrants an unconditional warning.  Assume it is
  3. 697    always declared, since it is required by C89.
  4. 698 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");*/
复制代码
然后再注释的行下面添加以下三行:
  1. #if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
  2. _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
  3. #endif
复制代码
保存退出!(注意#endif 下面还有一个 #endif):

重新编译即可!
发布了444 篇原创文章 · 获赞 136 · 访问量 37万+
展开阅读全文

liunx php编译安装提示 libiconv相关组件不存在

10-19

报错信息 ``` ext/iconv/.libs/iconv.o: In function `_php_iconv_strpos': /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:973: undefined reference to `libiconv_open' /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:1001: undefined reference to `libiconv' /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:1115: undefined reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_dtor': /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:2551: undefined reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_append_bucket': /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:2702: undefined reference to `libiconv' /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:2701: undefined reference to `libiconv' /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:2623: undefined reference to `libiconv' ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_ctor': /home/qyj/Downloads/php-5.6.3/ext/iconv/iconv.c:2577: undefined reference to `libiconv_open' collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1 ``` 按照网上的 方式 ``` ./configure --prefix=/application/php5.6.3 \ --with-apxs2=/application/apache/bin/apxs \ --with-mysql=/application/mysql \ --with-iconv-dir=/usr/local/libiconv \ --enable-xml \ --disable-rpath \ --enable-safe-mode \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --enable-mbregex \ --enable-mbstring \ --enable-gd-native-ttf \ --enable-pcntl \ --enable-sockets \ --enable-zip \ --enable-soap \ --enable-short-tags \ --enable-zend-multibyte \ --enable-static \ --enable-ftp ``` 参数加好 make &&make install 试了好几遍都不行 路径明明都配好了 libiconv 找不到 明明 路径是存在的 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 技术工厂 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览