g ++ – 4.6.real:错误:无法识别的选项’-R’

我正在尝试使用此configure命令从源代码编译phpcompiler 。

./configure --prefix=/opt/phc-0.3.0.1/ --with-php=/opt/php-5.3.17/ 

配置错误是,

 checking for exit in -lboost_regex-mt... no checking for exit in -lboost_regex-mt... (cached) no checking for exit in -lboost_regex... no checking for exit in -lboost_regex... (cached) no checking for exit in -lboost_regex... (cached) no configure: error: Could not link against boost_regex 

这完全错了,因为我安装了boost和boost_regex软件包。 libs和头文件。 然后我在config.log文件中挖了这个

 configure:17053: g++ -o conftest -g -O2 -L/lib/php5 -L/usr/lib/php5 conftest.cpp /usr/lib/libCrun.so.1 -lphp5 -L/opt/php-5.3.17//lib -R/opt/php-5.3.17//lib -ldl >&5 g++-4.6.real: error: /usr/lib/libCrun.so.1: No such file or directory g++-4.6.real: error: unrecognized option '-R' 

因此,对于这个unrecognized option '-R'错误,许多-lboost_regex检查都失败了!

我怎样才能解决这个问题? 有没有我可以编辑的文件来修复它? 为什么使用-R ? 我认为这将是-L标志。

由于您的注释表明此-R选项来自configure ,因此m4/php-embed.m4中的以下行似乎是最可能的来源:

 LIBS="-lphp5 -L${PHP_INSTALL_PATH}/lib -R${PHP_INSTALL_PATH}/lib $LIBS" 

如果你看一下configure ,所有其他的-R会把它写成${wl}-R ,其中${wl}最有可能扩展为-Wl, . 因此,解决此问题的一种方法是在上一行中添加前面的${wl}并运行autogen.sh来重新创建configure

在检查现有错误之后,您可能会为此提交错误 。