visual c++ - What do these common C++ compiler flags do? -
i'm starter in c++. i'm still confused flags in makefile.
-c. -o. -wall. -g. -std=c++0x.
can 1 tell me these common flags do?
only last flag (compiler command option) compiler-specific. first 3 or 4 have been de facto standard since, well, or mid 1980s, think. of course there’s no guarantee particular compiler understand them, they’re not uncommon.
note: while visual c++ accepts -
flag prefix notation, used /
flag prefix, since that’s common convention in windows.
-c
compile only, don't link.-o
specifies output file, e.g. executable. unfortunately deprecated visual c++ compiler. visual c++ use e.g./fe
.-wall
g++ practical warnings. visual c++ warnings including sillywarnings, , that's bunch!-g
generate debug information. supported many compilers not visual c++.
then,
-std=c++0x
g++ compiler-specific option specifies sort of c++11 standard. recall difference-std=c++11
, newer compiler versions accept both, former still permits g++-specific language extensions.
Comments
Post a Comment