Visual c ++ compiler options

Source: Internet
Author: User
  1. Visual c ++ compiler options

Compiler options listed by category

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 small code

/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

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

/CLR

Generate the output file to be run on the public Language Runtime Library

/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 applicable to IPF cross-platform compiler or IPF native compiler.

/G2

Optimized the Itanium2 processor. Only applicable to IPF cross-platform compiler or IPF native compiler.

/GD

Use_ CdeclCall conventions (x86 only)

/Ge

Activate stack Detection

/GF

Enable string pool

/GH

Call Hook Functions_ Penter

/GH

Call Hook Functions_ Pexit

/GL

Enable full-Program Optimization

/GM

Enable minimum regenerate

/GR

Enable runtime type information (rtti)

/GR

Use_ FastcallCall conventions (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_ StdcallCall conventions (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

Output file

Option Purpose

/FA

Create a list file and configure the name of the list file.

/FA

Create a list file catalog and set the list file name.

/FD

Rename a program database file

/Fe

Rename an executable file

/FM

Create a ing File

/Fo

Create object files

/FP

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

It is forced to write parameters in the passed Register into the stack when entering the function. This compiler option can only be used for x64 compilers (native 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 applicable to 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

/FL

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

Enable # pragma OMP in the source code.

/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 stack size

/LD

Create a dynamic link library

/LDD

Create a dynamic link library for debugging

/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

@

Response File

/?

List compiler options

/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 defaultCharType

/Nologo

Cancel display logon copyright mark

Qifist

Cancelling the Helper function when you need to convert from a floating point type to an integer type_ Ftol(X86 only)

/Qipf_ B

A single-step Error table based on B CPU does not generate a sequence of commands that give abnormal results. (IPF only)

/Qipf_c

A single-step Error table based on the c cpu does not generate a sequence of commands that give abnormal results. (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

/W

Set warning level

/W

Disable all warnings

/Wall

Enable all warnings, including warnings disabled by default

/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

See

Reference

Compiler Options

Set compiler options

Other resources

C/C ++ generation reference

Http://msdn.microsoft.com/zh-cn/library/19z1t1wy (vs.80). aspx

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.