mac编译openresty报Undefined symbols for architecture x86_64
时间:2016-05-17 01:08:23
收藏:0
阅读:1743
./configure --prefix=/usr/local/openresty --with-luajit --with-http_sub_module --add-module=../ngx_http_substitutions_filter_module-0.6.4
make时报错如下
-Wl,-rpath,/usr/local/openresty/luajit/lib -L/Applications/ngx_openresty-1.4.3.6/build/luajit-root/usr/local/openresty/luajit/lib -lluajit-5.1 -lm -pagezero_size 10000 -image_base 100000000 -lpcre -lssl -lcrypto -lz Undefined symbols for architecture x86_64: "_pcre_free_study", referenced from: _ngx_http_lua_regex_free_study_data in ngx_http_lua_regex.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [objs/nginx] Error 1 make[1]: *** [build] Error 2 make: *** [all] Error 2
解决方法:
# mdfind pcre | grep usr/local
找到 pcre 所在目录 /usr/local/Cellar/pcre/8.38/
修改参数:
# ./configure --prefix=/usr/local/openresty --with-luajit --with-http_sub_module --add-module=../ngx_http_substitutions_filter_module-0.6.4 --with-cc-opt="-I/usr/local/Cellar/pcre/8.38/include" --with-ld-opt="-L/usr/local/Cellar/pcre/8.38/lib"
再次make成功
评论(0)