运行passenger-install-nginx-module时出undefined reference to symbol 'pow@@GLIBC_2.错误

-lpthread -lcrypt -lm /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/nginx/../common/libpassenger_common.a /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/nginx/../common/libboost_oxt.a -lstdc++ -lpthread /tmp/root-passenger-20247/pcre-8.12/.libs/libpcre.a -lssl -lcrypto -ldl -lz
/usr/bin/ld: /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/nginx/../common/libpassenger_common.a(aggregate.o): undefined reference to symbol 'pow@@GLIBC_2.0'
/usr/bin/ld: note: 'pow@@GLIBC_2.0' is defined in DSO /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libm.so so try adding it to the linker command line
/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/libm.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[1]: *** [objs/nginx] 错误 1
make[1]:正在离开目录 `/tmp/root-passenger-20247/nginx-1.0.6'
make: *** [build] 错误 2

解决办法:
修改
/usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/nginx/config 

文件(这个目录是passenger的安装目录,在你的gems目录中找,要是不知道可以运行gem env,可以看到有个INSTALLATION DIRECTORY),把下面这段代码
ngx_feature="Math library"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <math.h>"
ngx_feature_path=
ngx_feature_libs="-lm"
ngx_feature_test="pow(1, 2)"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS -lm"
fi

移到下面这段代码后面
ngx_addon_name=ngx_http_passenger_module
HTTP_MODULES="$HTTP_MODULES ngx_http_passenger_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS \
${ngx_addon_dir}/ngx_http_passenger_module.c \
${ngx_addon_dir}/Configuration.c \
${ngx_addon_dir}/ContentHandler.c \
${ngx_addon_dir}/StaticContentHandler.c"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS \
${ngx_addon_dir}/Configuration.h \
${ngx_addon_dir}/ContentHandler.h \
${ngx_addon_dir}/StaticContentHandler.h \
${ngx_addon_dir}/ngx_http_passenger_module.h \
${ngx_addon_dir}/../common/Constants.h"
CORE_LIBS="$CORE_LIBS \
${ngx_addon_dir}/../common/libpassenger_common.a \
${ngx_addon_dir}/../common/libboost_oxt.a \
-lstdc++ -lpthread"


相关文章:[url]http://groups.google.com/group/phusion-passenger/browse_thread/thread/396f8d0ef9562e7a/c66984f188975884?show_docid=c66984f188975884[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值