gcc -R参数有什么作用?

ctr*_*oot 6 c++ g++ autotools

我正在尝试为bson-cpp项目运行autotools configure脚本,但它失败了,因为它无法确定使用boost_filesystem编译需要哪些标志.快速浏览confg.log显示:

g++ -o conftest -g -O2   -pthread  -L/usr/local/lib -R/usr/local/lib -L/usr/local/libexec conftest.o -lboost_filesystem-mt  -lboost_system-mt >&5
g++: error: unrecognized option '-R'
Run Code Online (Sandbox Code Playgroud)

所以,当然,我试图找出R选项的作用,但我似乎无法在任何地方找到它.我检查了这里,并在这里无济于事.该选项有什么作用,如何告诉autotools不使用它?

Ahm*_*sud 7

-R似乎不是g ++或gcc的选项.-R可能是某些平台上的链接器选项,相当于-rpath到gnu ld,...这似乎是boost构建中的一个已知错误...看看使用-Wl将参数传递给链接器.

它实际上有补丁可用

我为了方便而重新发布它,但是请看看上面链接的官方补丁的原始URL!

--- ../gnote/m4/boost.m4    2011-01-25 14:30:18.000000000 +0200
+++ m4/boost.m4 2011-02-27 20:57:11.686221539 +0200
@@ -403,7 +403,7 @@
       LDFLAGS=$boost_save_LDFLAGS
       LIBS=$boost_save_LIBS
       if test x"$Boost_lib" = xyes; then
-        Boost_lib_LDFLAGS="-L$boost_ldpath -R$boost_ldpath"
+        Boost_lib_LDFLAGS="-L$boost_ldpath -Wl,-R$boost_ldpath"
         Boost_lib_LDPATH="$boost_ldpath"
         break 6
       else
Run Code Online (Sandbox Code Playgroud)