简体   繁体   English

Visual C ++编译器的默认选项

[英]Visual C++ compiler's default options

Can you tell me what are the __DEFAULT__ , implicit compiler options for cl.exe and for link.exe when compiling from the command line, like: 你能告诉我从命令行 编译时 cl.exe和link.exe的__DEFAULT__隐式编译器选项是什么,如:

cl whatever.c

Thanks! 谢谢!

update : To clarify: I am not interesed in the available command line options, I have even linked them from the question. 更新 :澄清:我没有参与可用的命令行选项,我甚至将它们与问题联系起来。 What I am asking for is a list of implicit, default command line options used when you specify none and compile from the command line. 我要求的是当您指定none并从命令行编译时使用的隐式命令行选项列表。

There does not seem to be much information on the actual defaults on microsoft web sites, however Geoff Chappell seems to have done some research into this subject. 关于微软网站上的实际默认值似乎没有太多信息,但是Geoff Chappell似乎已经对这个主题做了一些研究。 Here is the link: 链接在这里:

http://www.geoffchappell.com/viewer.htm?doc=studies/msvc/cl/cl/initial.htm&tx=27 http://www.geoffchappell.com/viewer.htm?doc=studies/msvc/cl/cl/initial.htm&tx=27

As we all know what the documentation says, and what the software actually does, are two different things. 众所周知,文档所说的内容,以及软件的实际功能,都是两回事。

To further answer the question, you can see what options cl passes to the compiler modules c1xx.dll and c2.dll by passing the /Bd option to cl: 要进一步回答这个问题,您可以通过将/ Bd选项传递给cl来查看cl传递给编译器模块c1xx.dll和c2.dll的选项:

cl /Bd helloworld.cpp

To see the environment variables that the compiler and linker uses type: 要查看编​​译器和链接器使用的环境变量,请执行以下操作:

cl /Be helloworld.cpp

I always just search google for "cl options". 我总是只搜索谷歌的“cl选项”。
This is the current top hit: Compiler Command-Line Syntax (C++) [MSDN] 这是目前最受欢迎的: 编译器命令行语法(C ++)[MSDN]

As is usual for Microsoft documentation, it is a bit haphazard, but it does seem to be complete. 与Microsoft文档一样,它有点随意,但似乎确实完整。 When an option is the default setting, that is noted (not in any consistent manner, though.) 如果选项是默认设置,则会注明(但不是以任何一致的方式)。

Check cl /? 检查cl /? on link /? link /? at the command line. 在命令行。 I believe that the defaults differ for each version. 我相信每个版本的默认值都不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM