运行passenger-install-nginx-module时出undefined reference to symbol pow@@GLIBC_2.错误_Ruby_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > Ruby > 运行passenger-install-nginx-module时出undefined reference to symbol pow@@GLIBC_2.错误

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

 2011/9/23 8:28:55  suchj  http://suchj.iteye.com  我要评论(0)
  • 摘要:-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/
  • 标签:
-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
  • 相关文章
发表评论
用户名: 匿名