g++编译和链接选项
也许是天真的问题,g++ 是否有单独的编译和链接选项列表,我的意思是一个显示哪些选项用于编译、哪些选项用于链接的列表。 gcc 手册说这些是链接选项
http://gcc.gnu .org/onlinedocs/gcc/Link-Options.html#Link-Options
以及除这些之外的选项是编译选项吗?我在阅读 GCC 明确指南时感到困惑。
naive question perhaps, are there separate lists of compile and link options for g++, I mean a list that shows which options are for compiling and which are for linking. gcc manual says these are the link options
http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#Link-Options
and the options other than these are compile options? I am confused while reading the Definite Guide to GCC.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有一个所有选项的分组列表。使用总体选项,例如 -c 和 -o 以及特定的C++ 选项。
There is a grouped list of all options. With overall options such as -c and -o and specific c++ options.
如果您阅读
gcc
的手册(您在链接中引用的内容似乎是它的一个版本,但也请在您的计算机上检查man gcc
),您会发现它有很好的标记部分,例如“C++ 语言选项”、“语言独立选项”、“链接器选项”等。我认为这非常清楚。If you read the manual for
gcc
(what you referring to with your link seems to be a version of it, but checkman gcc
on your machine too), you will find that it has well labelled sections such as "C++ Language Options", "Language Independent Options", "Linker Options" etc. I think this is pretty clear.这些选项专门以链接阶段描述的方式应用,并且其他一些选项也可能会影响链接时的输入/输出和一般行为。所以我想说不,除了这组选项之外的选项并不是唯一的编译选项。
请考虑您还可以选择预处理器和其他编译阶段。
These option apply specifically in the way described on the linking stage, and some other options may affect the input/output and general behaviour while linking too. So I would say No, options other than this set are not exclusively compile options.
Consider that you also have options for the preprocessor and other stages of compilation.