Compiler Options (from msdn) and VC project configuration Basics

Source: Internet
Author: User
Tags visual studio 2010
VC project configuration BASICS (click to open)

Compiler options listed by category Visual Studio 2010 other versions Visual Studio 2008 Visual Studio 2005

The following is a complete list of compiler option categories. For a list in alphabetical order, see compiler options listed in alphabetical order.

Optimization

Option

Purpose

/O1

Create smallCode

/O2

Create quick code

/Ob

Control Inline expansion

/OD

Disable Optimization

/Og

Use global optimization

/OI

Generate internal functions

/OS

Code size first

/OT

Code speed first

/Ox

Maximum Optimization (/ob2gity/GS)

/Oy

Frame pointer omitted (x86 only)

Code Generation

Option

Purpose

/Arch

Use the SSE or sse2 command to generate code (x86 only)

/Bigobj

Increase the number of addressable segments in the. OBJ file.

/CLR

Generate the output file to run in public language

/Eh

Exception Handling Model

/Favor

The code is generated into a specific x64 structure or optimized for the specific macro structure in the amd64 and 64-Bit Memory extension technology (em64t) structures.

/FP

Specify floating point behavior.

/G1

Optimized the itanium processor. Only available in IPF cross-platform compiler or IPF native compiler.

/G2

Optimized the Itanium2 processor. Only available in IPF cross-platform compiler or IPF native compiler.

/GD

Use the _ cdecl call Convention (x86 only)

/Ge

Activate stack Detection

/GF

Enable string pool

/GH

Call hook function _ penter

/GH

Call hook function _ pexit

/GL

Enable allProgramOptimization

/GM

Enable minimum regenerate

/GR

Enable runtime type information (rtti)

/GR

Use the _ fastcall call Convention (x86 only)

/GS

Control Stack Detection

/GT

Support fiber-path security for data allocated using the local storage area of static threads

/GX

Enable synchronization Exception Handling

/Gy

Enable function-level Link

/GZ

Use the _ stdcall call Convention (x86 only)

/MD

Use msvcrt. lib to create multi-thread DLL

/MDD

Use msvcrtd. lib to create and debug multi-thread DLL

/Mt

Use libcmt. lib to create multi-thread executable files

/MTD

Use libcmtd. lib to create and debug multi-thread executable files

/Qfast_transcendentals

Generate a quick anterior.

/Qimprecise_fwaits

Remove the fwait command from the try block.

Output file

Option

purpose

/FA

Create a list file and set a list file name

/FA

Create a list file and set a list file name

/FD

rename a program database file

/Fe

Rename an executable file

/FI

specify the pre-processing output file name

/FM

Create a ing file

/FO

Create an object file

/FP

specify the precompiled header file name

/fr/FR

Generate a Browser file

/FX

merge the inserted code with the source file

Debugging

Option

Purpose

/GS

Buffer Zone Security Check

/GZ

Same as/rtc1

/Homeparams

Write the parameters of the input register to their position on the stack of the function entry. This compiler option is only applicable to x64 compilers (native compilation and cross-platform compilation ).

/RTC

Enable runtime error check

/Wp64

Detection of 64-bit portability

/Yd

Place complete debugging information in all object files

/YL

Insert a PCH reference when creating a debugging Library

/Z7

Generate debugging information compatible with C 7.0

/Zi

Generate complete debugging information

/Zi

Include debugging information in the program database compatible with "edit and continue" (x86 only)

/ZX

Generate debugging optimization code. Only available in IPF cross-platform compiler or IPF native compiler.

Pre-processor

Option

Purpose

/AI

Specifies the directory to be searched when parsing a file that is passed to the # using command

/C

Retained comments during preprocessing

/D

Define constants and macros

/E

Copy Preprocessor output to standard output

/EP

Copy Preprocessor output to standard output

/FI

Pre-process specified contained files

/Fu

Force use of the file name, just as it has been passed to the # using command

/I

Search for files in the directory

/P

Write the pre-processor output to a file

/U

Remove a predefined macro

/U

Remove all predefined macros

/X

Ignore standard inclusion directory

Language

Option

Purpose

/OpenMP

InSource codeEnable # pragma OMP.

/VD

Cancel or enable hidden vtordisp class members

/Vmb

Use the best base for pointers to members

/Vmg

The pointer to a member is completely generic.

/Vmm

Declare multiple inheritance

/VMS

Declare single inheritance

/Vmv

Declare virtual inheritance

/Za

Disable Language extension

/ZC

Specify standard behavior under/ze

/Ze

Enable Language extension

/ZG

Generate function prototype

/ZL

Remove the default library name from the. OBJ file

/Zpn

Encapsulation structure member

/Zs

Only check syntax

Link

Option

purpose

/F

set the stack size

/LD

create a dynamic link library

/LDD

Create and debug a dynamic link library

/ln

Create an msil module.

/link

pass the specified option to link

/MD

Use msvcrt. lib to compile to create multi-threaded DLL

/MDD

Use msvcrtd. lib to compile and debug multi-thread DLL

/mt

Use libcmt. lib to compile to create multi-thread executable files

/MTD

Use libcmtd. lib to compile and debug multi-thread executable files

Precompiled header

Option

Purpose

/Y-

Ignore all other precompiled header compiler options currently generated

/YC

Create a precompiled header file

/Yd

Place complete debugging information in all object files

/Yu

Use pre-compiled header files during generation

Miscellaneous

Option

Purpose

/?

List compiler options

@

Response File

/Analyze

Enable code analysis.

/C

Compiled but not linked

/Doc

Process the annotation of an XML file.

/Errorreport

Allows you to directly provide internal compiler error (ICE) Information to the Visual C ++ team.

/FC

The diagnostic text displays the complete path of the source code file passed to cl.exe.

/H

Restrict the length of external (public) Names

/Help

List compiler options

/Hotpatch

Create a ghost repaired image.

/J

Change the default char type

/MP

Multiple source files are generated at the same time.

/Nologo

Cancel display logon copyright mark

Qifist

Call the Helper function _ ftol (x86 only) when you need to convert the floating point type to an integer)

/Qipf_ B

If no command sequence is generated, the B CPU executes the command sequence of the abnormal result contained in the error table in one step. (IPF only)

/Qipf_c

If no command sequence is generated, the B CPU executes the command sequence of the abnormal result contained in the error table in one step. (IPF only)

/Qipf_fr32

The 96-bit floating point register is not used. (IPF only)

/Qipf_nopic

Generate an image with location-related code (IPF only ).

/Qipf_restrict_plabels

Enhances the performance of programs that do not create functions at runtime. (IPF only)

/Showincludes

Display the list of all files included during compilation

/TC

Specify C source file

/TP

Specify the C ++ source file

/V

Set version string

/Wall

Enable all warnings, including warnings disabled by default

/W

Set warning level

/W

Disable all warnings

/WL

Enable single-line Diagnosis of error messages and warning messages when compiling C ++ source code from the command line

/ZM

Specify the pre-compiled header memory allocation limit

Although there are on msdn, sometimes foreign websites cannot be opened, I would like to back up an article here.

[Thank you for your reference]

VC project configuration Basics

Compiler options listed by category

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.