编译nginx时提示undefined reference to 'pcre_free_study' 的问题及解决

./configure --add-module=../ngx_devel_kit-0.2.19/ --add-module=../lua-nginx-module-0.9.19/  --with-ld-opt="-L /usr/local/lib"  

 在末尾加上 --with-ld-opt="-L /usr/local/lib", 这个路径是pcre的安装路径。

 

还有另外一种方式,是使用源码,在后面加上:

--with-pcre=../pcre-8.30 --with-pcre-jit 

pcre-8.30为pcre的源码,它与nginx的源码放在同级目录。

原文地址:https://www.cnblogs.com/dehai/p/5052098.html