gcc -R参数有什么作用? [英] What does the gcc -R parameter do?
问题描述
我试图为bson-cpp项目运行一个autotools配置脚本,并且它失败了,因为它无法确定它需要用boost_filesystem进行编译的标志。快速查看confg.log显示:
I am trying to run an autotools configure script for the bson-cpp project, and it fails because it cannot determine what flags it needs to compile with boost_filesystem. A quick look at confg.log shows:
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'
因此,我试图找出R选项的作用,但我似乎无法找到它随处记录。我已检查此处和此处无济于事。这个选项有什么作用,我该如何告诉autotools不要使用它?
So, naturally, I tried to find out what the R option does, but I can't seem to find it documented anywhere. I've checked here and here to no avail. What does the option do and how do I tell autotools not to use it?
推荐答案
-R似乎不是一个选项适用于任何地方的g ++或gcc。 -R可能是一些平台上的链接器选项,相当于-rpath到gnu ld,...这似乎是boost构建中的已知错误...看看使用-Wl将参数传递给链接器
-R does not seem to be an option for g++ or gcc anywhere. -R may be a linker option on some platforms that is equivalent of -rpath to gnu ld, ... This seems to be a known bug in boost builds ... have a look at Use -Wl to pass arguments to the linker.
它实际上在那里有补丁
为方便起见,我重新发布它,但请参阅上面链接的官方补丁的原始网址
--- ../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
这篇关于gcc -R参数有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!