`
suchj
  • 浏览: 146146 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

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

    博客分类:
  • ruby
阅读更多
-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" 


相关文章:http://groups.google.com/group/phusion-passenger/browse_thread/thread/396f8d0ef9562e7a/c66984f188975884?show_docid=c66984f188975884
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics