Options available when using the VC ++ compiler with bare hands

Source: Internet
Author: User

Compile (VC compiler program. When using Cl, there are many optional parameters to help us complete seemingly complex functions, such as compiling and connecting to a DLL (dynamic connection library ). Let's take a look at the Parameter options below: they are all easy English and will not be translated :)

-Optimization-

/O1 minimize space/OP [-] Improve floating-Pt consistency
/O2 maximize speed/OS favor code space
/OA assume no aliasing/OT favor code speed
/Ob <n> Inline expansion (default n = 0)/ow assume cross-function aliasing
/OD disable optimizations (default)/Ox maximum opts. (/ogityb1/GS)
/Og enable global optimization/Oy [-] Enable frame pointer Omission
/OI enable intrinsic functions

-Code Generation-

/G3 optimize for 80386/gy separate functions for linker
/G4 optimize for 80486/Ge force stack checking for all funcs
/G5 optimize for Pentium/GS [num] disable stack checking cballs
/G6 optimize for Pentium Pro/GH enable hook function call
/GB optimize for blended model (default)/GR [-] Enable C ++ rtti
/Gd _ cdecl calling convention/GX [-] Enable C ++ EH (same as/ESCS)
/GR _ fastcall calling convention/GI [-] Enable incremental compilation
/GZ _ stdcall calling convention/GM [-] Enable minimal rebuild
/Ga optimize for Windows application/EHS enable synchronous C ++ eh
/GD optimize for Windows dll/EHA enable asynchronous C ++ eh
/GF enable string pooling/EHC extern "C" defaults to nothrow
/GF Enable Read-Only string pooling/qifdiv [-] Enable Pentium fdiv fix
/GZ enable runtime debug checks/qi0f [-] Enable Pentium 0x0f fix

-Output files-

/FA name Assembly listing file/FO <File> name object file
/Fa [SC] configure Assembly listing/FP <File> name precompiled header file
/FD name. PDB file/FR name source browser File
/Fe <File> name Executable File/FR name extended. SBR File
/FM name Map File

-Preprocessor-

/C don't strip comments/FI <File> name forced include file
/D <name >{=|#}< text> define macro/u <Name> remove predefined macro
/E preprocess to stdout/u remove all predefined macros
/EP preprocess to stdout, no # Line/I <dir> Add to include search path
/P preprocess to file/X ignore "standard places"

-Language-

/Zi enable debugging information/ZL omit default library name in. OBJ
/Zi Enable Edit and continue debug info/ZG generate function prototypes
/Z7 enable old-style debug info/zs syntax check only
/ZD line number debugging info only/VD {0 | 1} disable/enable vtordisp
/ZP [N] Pack structs on n-byte boundary/Vm <x> type of pointers to members
/Za disable extensions (implies/OP)/nobool disable "bool" keyword
/Ze enable extensions (default)

-Miscellaneous-

/?, /Help print this help message/V <string> set version string
/C compile only, no link/W disable all warnings
/H <num> MAX external Name Length/W <n> set warning level (default n = 1)
/J default char type is unsigned/wx treat warnings as errors
/Nologo suppress copyright message/YC create. PCH File
/Tc <Source File> compile file as. c/Yd put debug info in every. OBJ
/TP <Source File> compile file as. CPP/Yu use. PCH File
/TC compile all files as. c/Yx automatic. PCH
/TP compile all files as. CPP/ZM <n> MAX memory alloc (% of default)

-Linking-

/MD link with msvcrt. lib/MDD link with msvcrtd. Lib debug lib
/Ml link with libc. lib/MLD link with libcd. Lib debug lib
/MT link with libcmt. lib/MTD link with libcmtd. Lib debug lib
/LD create. dll/F <num> set stack size
/LDD create. dll debug libary/link [Linker Options and libraries]

Note that VC ++ is not a standard C ++ compiler. There are some options used only for VC programs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.