user200557
user200557

Reputation: 9119

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

Upvotes: 10

Views: 3908

Answers (3)

wozname
wozname

Reputation: 223

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

Upvotes: 5

alex tingle
alex tingle

Reputation: 7221

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

Upvotes: 1

D.Shawley
D.Shawley

Reputation: 59553

Check cl /? on link /? at the command line. I believe that the defaults differ for each version.

Upvotes: 0

Related Questions