Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual C++ compiler's default options

Tags:

c++

visual-c++

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 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.

like image 592
user200557 Avatar asked Nov 01 '09 18:11

user200557


2 Answers

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. Here is the link:

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:

cl /Bd helloworld.cpp

To see the environment variables that the compiler and linker uses type:

cl /Be helloworld.cpp
like image 162
wozname Avatar answered Sep 29 '22 02:09

wozname


I always just search google for "cl options".
This is the current top hit: Compiler Command-Line Syntax (C++) [MSDN]

As is usual for Microsoft documentation, it is a bit haphazard, but it does seem to be complete. When an option is the default setting, that is noted (not in any consistent manner, though.)

like image 22
alex tingle Avatar answered Sep 29 '22 02:09

alex tingle