mac编译openresty报Undefined symbols for architecture x86_64
1
./configure --prefix=/usr/local/openresty --with-luajit --with-http_sub_module --add-module=../ngx_http_substitutions_filter_module-0.6.4
make时报错如下
1
2
3
4
5
6
7
8
9
-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: *** Error 1
make: *** Error 2
make: *** Error 2
解决方法:
1
# mdfind pcre | grep usr/local
找到 pcre 所在目录 /usr/local/Cellar/pcre/8.38/
修改参数:
1
# ./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成功
页:
[1]