环境:
系统:Red Hat Enterprise Linux Server release 5.1
nginx:nginx-1.0.11
出现的情况:
configure通过,make时出现下面的错误
/usr/bin/ld: skipping incompatible /usr/local/lib/perl5/5.12.1/i686-linux/CORE/libperl.a when searching for -lperl
/usr/bin/ld: cannot find -lperl
collect2: ld 返回 1
make[1]: *** [objs/nginx] 错误 1
make[1]: Leaving directory `/opt/nginx-1.0.11'
make: *** [build] 错误 2
处理过程:
折腾不少时间,最后发现系统所用的perl与编译时选择的perl版本不一致引起
./configure 的返回内容
....................... 略 .......................
checking for perl
+ perl version: This is perl 5, version 12, subversion 1 (v5.12.1) built for i686-linux
creating objs/Makefile
Configuration summary
+ using system PCRE library
+ OpenSSL library is not used
+ md5: using system crypto library
+ sha1: using system crypto library
+ using system zlib library
....................... 略 .......................
系统的perl版本:
[root@server]# rpm -q perl
perl-5.8.8-10
解决方法:
在configure选项中指定perl后问题解决,如
./configure --with-perl=/usr/bin/perl5.8.8