運行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]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章