mac编译openresty报Undefined symbols for architecture x86_64

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mac编译openresty报Undefined symbols for architecture x86_64相关的知识,希望对你有一定的参考价值。

./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成功

以上是关于mac编译openresty报Undefined symbols for architecture x86_64的主要内容,如果未能解决你的问题,请参考以下文章

Openresty使用Thrift安装步骤

单独编译PCL的kdtree模块报错“undefined reference to”

MAC编译出错:Undefined symbols for architecture x86_64: “_CFRelease“, referenced from:

用qt484编译程序的时候,报错误 libQtGui.so: undefined reference to `FcFreeTypeQueryFace'

mac上执行sed的编辑 -i命令报错sed: 1: "test.txt": undefined label ‘est.txt’或sed: 1: "2a est&qu

Linux C语言编译报错:undefined reference to `sem_init‘(编译时加 -lpthread)