Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the C++ compiler commands?

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you what the C++ compiler commands are. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

It is going to be crazy by the compiler of VC6.0. According to its own coding speed, we should basically compile the driver communication module today, but unexpectedly, VC6.0 does not support the most supported driver framework (WDK). After looking for information on the Internet all afternoon, there is no quick way to solve it, so we have no choice but to use the most primitive and stupid method-write an ieWraper to package the WDK API to be called. Then compile to DLL under the environment of WDK, and then call DLL.

For C++ compiler commands in addition to a few simple commands, many are unfamiliar, and then check Cl help (cl/?), but think this is very inconvenient, after every time you want to see the console. So I went to MSDN to see if there was any convenient help, but these command help were scattered, and I felt uncomfortable about it, so I looked at it on google and there was no complete command help. I had plenty of food and clothing by myself, so I decided to write the command line console commands to Blog. To get familiar with it, 2. It is for the convenience of yourself and everyone in the future.

The compiler I use is the compiler version on WDK: 14.00.50727.22.

Cmax Candle + COMPILER OPTIONS

Usage:cl [option...] Filename... [/ link linkoption]

-- OPTIMIZATION-- of C++ compiler command

/ O1 minimize space / O2 maximize speed

/ Ob

< n>

Inline expansion (defalut nasty 0)

/ Od disable opimization (default)

/ Og enable global optimization

/ Oi [-] enable intrinsic functions

/ Os favor code sapce / Ot favor code speed

/ Ox maximum optmations / Oy [-] enable frame pointer omission

-- CODE GENERATION-- of C++ compiler command

/ GF enable read-only string pooling / Gm [-] enable minimal rebuild

/ Gy [-] separate functions for linker / GS [-] enable security checks

/ GR [-] enable C++ RTTI / GX [-] enalbe C++ EH (same as / EHsc)

/ EHs enable C++ EH (no SEH exceptions)

/ EHa enable C++ EH (w/SEH exceptions)

/ fp:

< except[-]|fast|precise|strict>

Choose floating-point model:

Except [-]-consider floating-point exceptions when generating code

Fast- "fast" floating-point model;results are less predictable

Precise- "precise" floating-point model;result are predictable

Strict- "strict" floating-point model (implies/fp:except)

/ GL [-] enable link-time code generation

/ GA optimize for windows application

/ Ge force stack check for all funcs

/ Gs [num] control stack checkings calls

/ Gh enable _ penter function call / GH enable _ pexit function call

/ GT generate filber-safe TLS accesses

/ RTC1 Enable fast checks (/ RTCsu)

/ RTCc convert to small type checks / RTCs stack Frame runtime checking

/ RTCu uninitialized local usage checks

/ clr [: opt] compile for common language runtime,where option is:

Pure-produce IL-only output file (no native executable code)

Safe-prdouce IL-only verifiable output file

Oldsyntax-accept the Managed Extensions syntax

From Visual C++ 2000/2003

InitialAppDomain-enable inital AppDomain behavior of Visual C++ 2002

NoAssembly-do not produce an assembly

/ Gd _ _ cdecl calling convertion / Gr _ _ fastcall calling convertion

/ Gz _ stdcall calling convertion / GZ Enable stack checks (RTCs)

/ Qifist [-] use FIST instead of ftol ()

/ hotpatch ensure function padding for htpatchable images

/ arch:

< SSE|SE2>

Minimum CPU architecture requirements,one of:

SSE-enable use of instructions available with SSE enabled CPUS

SSE2-enable use off instructions available with SSE2 enabled CPUS

-OUTPUT FILES-

/ Fa [file] name assembly listing file / FA [scu] configure assembly listing

/ Fd [file] name .PDB file / Fe

< file>

Name executable file

/ Fm [file] name map file / Fo

< file>

Name object file

/ Fp

< file>

Name precompiled header file / Fr [file] name source browser file

/ FR [file] name extended .SBR file

/ doc [file] process XML documentation comments

And optionally name the .xdc file

-- PREPROCESSOR-- of C++ compiler command

/ AI

< dir>

Add to assembly search path

/ FU

< file>

Forced using assembly/model

/ C don't strip coments / D

< name>

{= | #}

< ext>

Define macro

/ E preprocess to stdout / EP preprocess to stdout,no#line

/ P precprocess to file / Fx merge injected code to file

/ FI

< file>

Name forced include file / U

< name>

Remove predefined macor

/ u remove all predefined macors / I

< dir>

Add to include search pth

/ X ignore "standard places"

-- LANGUAGE-- of C++ compiler command

/ Zi enable debugging information / Z7 enable old-style debug info / Zp [n] pack structs on n-byte boundary / Za disable extensions / Ze enable extenstions (defalut) / Zl omit default library name in .OBJ / Zg generate function prototypes / Zs syntax check only / vd {0 | 1 | 2} disable/enable vtordisp / vm

< x>

Type of pointers to members / Zc:arg1 [, arg2] C++ lanuage confomance,where arguments can be: forScope [-]-enforce Stand C++ for scoping rules wchar_t [-]-wchar_t is the native type,not a typedef / ZI enable Edit and Continue debug info / openmp enable OpenMP 2.0 language extensions

-- MISCELLANEOUS-- of C++ compiler command

@

< FILE>

Options response file /?, / help print this help message

/ bigobj generate extended object format / c compile only,no link

/ errorReport:option Report internal compiler errors to Microsoft

None-do not send report

Prompt-prompt to immediately send report

Queue-at next admin logon, prompt to send report (default)

Send-send report automatically

/ FC use fall pathnames in diagnostcs / H

< num>

Max external name lenght

/ J default char type is unsigned / nologo suppress copyright message

/ showInclude show include file names / TC compile all files as .c

/ Tp

< source file>

Compile file as .cpp / TC compile all file as .c

/ TP compile all files as .cpp / V

< string>

Set version string

/ w disable all warnings / wd

< n>

Disable warning n

/ we

< n>

Treat warning n as an error / wo

< n>

Issue warning n once

/ w

< l>

< n>

Set warning level 1-4 for n / W

< n>

Set warning level (defalut n = 1)

/ Wall enable all warnings / WL enable one line diagnostics

/ WX treat warning as errors / Yc [file] create .PCH file

/ Yd put debug info in every .OBJ / Yl [sym] inject .PCH ref for debug lib

/ Yu [file] use .PCH file / Y-disable all PCH options

/ Zm

< n>

Max memory alloc (% of defalut) / Wp64 enable 64 bit porting warnings

-- LINKING-- of C++ compiler command

/ LD Create .DLL / LDd Create .Dll debug library / LN Create a .netmodule / F [num] set stack size / link [linker options and libraries] / MD link with MSVCRT.LIB / MT link with LIBCMT.LIB / MDd link with MSVCRTD.LIB deubg lib / MTd link with LIBCMTD.LIB debug lib Thank you for reading! This is the end of this article on "what are the C++ compiler commands?". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report