Cl.exe command lines in

Source: Internet
Author: User
Tags intel pentium

 

The CL command line uses the following syntax:

Cl [option...] file... [Option | file]... [Lib...] [@ command-file] [/link-opt...]

The following table describes the meaning of the entered CL command.


Option one or more Cl options. Note that all options are applied to all specified source files. The options are specified by a forward slash (/) or A hyphen. If an option has a parameter, the description of this option specifies whether spaces are allowed between the option and the parameter. The option name (except for the/help option) is case sensitive. For more information, see the order of CL options.


The name of one or more source files,. OBJ files, or libraries. CL compiles the source file and passes the. OBJ file and library name to the linker. For more information, see CL file name syntax.

One or more library names in Lib. CL passes these names to the linker.

Command-file contains multiple options and file names. For more information, see the CL command file.

Link-opt one or more Linker Options. CL passes these options to the linker.

You can specify any number of options, file names, and database names. The condition is that the number of characters on the command line cannot exceed 1024, which is specified by the operating system.

Compiler

Note that all compiler options are case sensitive.

Use/C to compile but not link it.

Use nmake to generate output files.
Use BSCMAKE to support class browsing.

The following is a complete list of compiler option categories.

I. Optimization
Option Function
/O1 create small code
/O2 create quick code
/OA assumes no alias
/Ob control Inline expansion
/OD disabling Optimization
/Og use global optimization
/OI generate internal functions
/OP improves floating point consistency
/OS code priority
/OT code speed first
/Ow assumes that aliases are used in function calls.
/Ox maximum optimization (/ob1gity/GS)
/Oy omitting frame pointer

Ii. Code Generation
Option Function
/CLR enables C ++ managed extensions and generates output files running on the Common Language Runtime Library
/EH specifies the Exception Handling Model
/G3 optimization code to optimize the 386 processor. This option is disabled in Visual C ++ 5.0 and will be ignored by the compiler.
/G4 optimization code to optimize the 486 processor. This option is disabled in Visual C ++ 5.0 and will be ignored by the compiler.
/G5 optimization code to optimize Pentium
/GB is equivalent to/g6; Set _ m_ix86 to 600
/GD use _ cdecl call Convention
/Ge activate stack Detection
/GF
/GF enable string pool
/GH call hook function _ penter
/GH call hook function _ pexit
/GL enable full-Program Optimization
/GM enables minimum regenerate
/GR enable runtime type information (rtti)
/GR use _ fastcall call Convention
/GS control stack Detection
/GT supports fiber-path security for data allocated by the local storage area using static threads
/GX enable synchronization Exception Handling
/Gy enable function-level Link
/GZ use _ stdcall call Convention
/MD use msvcrt. lib to create multi-thread DLL
/MDD use msvcrtd. lib to create and debug multi-thread DLL
/Ml use libc. lib to create a single-thread Executable File
/MLD use libcd. lib to create and debug single-thread executable files
/MT uses libcmt. lib to create multi-thread executable files
/MTD use libcmtd. lib to create and debug multi-thread executable files

Iii. output file
Option Function
/FA: Create a list file
/FA sets the list file name

/FD rename the program database file
/Fe rename the executable file
/FM create a ing File
/FO: Create an object file
/FP specifies the precompiled header file name
/FR
/FR generate a Browser file
/FX merge the inserted code with the source file

Iv. debugging
Option Function
/GS buffer security check
/GZ is the same as/rtc1
/RTC enable runtime error check
/Wp64 detection of 64-bit portability
/Yd put the complete debugging information in all object files
/YL inserts a PCH reference when creating the debugging Library
/Z7 generates debugging information compatible with C 7.0
/ZD generate row number
/Zi to generate complete debugging information

V. Pre-Processor
Option Function
/AI specifies the directory to be searched when parsing a file that is passed to the # using command
/C keep comments during preprocessing
/D defines constants and macros
/E. Copy the pre-processor output to the standard output.
/EP copies the pre-processor output to the standard output
/FL pre-processing specified include files
/Fu enforces the use of file names, just as it has been passed to the # using command
/I search for include files in the directory
/P writes the pre-processor output to a file
/U remove predefined macros
/U remove all predefined macros
/X ignore standard inclusion Directories
/Zi includes debugging information in the program database compatible with "edit and continue"

Vi. Language
Option Function
/Nobool cancel the C ++ bool, true, and false keywords
/VD cancel or enable hidden vtordisp class members
/Vmb uses the best base for pointers to members
/Vmg uses completely generic pointers to members
/Vmm declares multiple inheritance
/VMS declares single inheritance
/Vmv declares virtual inheritance
/Za disable Language extension
/ZC specifies the standard behavior under/ze
/Ze enable language Extension
/ZG generate function prototype
/ZL removes the default library name from the. OBJ file
/Zpn encapsulation structure member
/Zs only checks the syntax

VII. Links
Option Function
/F set the stack size
/LD create dynamic link library
/LDD create and debug Dynamic Link Library
/Link: Pass the specified option to link
/MD uses msvcrt. lib to compile to create multi-threaded DLL
/MDD is compiled using msvcrtd. lib to create and debug multi-thread DLL
/Ml uses libc. lib to compile to create a single-thread Executable File
/MLD uses libcd. Lib compilation to create a single-thread executable file for debugging
/MT uses libcmt. Lib compilation to create multi-thread executable files
/MTD uses libcmtd. lib to compile and debug multi-thread executable files

VIII. Pre-compiled Headers
Option Function
/Y-ignore all other precompiled header compiler options in the current build
/YC create pre-compiled header file
/Yd put the complete debugging information in all object files
/Yu uses the pre-compiled header file during generation
/Yx automatically processes the pre-compiled Header

IX. Miscellaneous
Option Function
@ Specify the response File
/? List compiler options
/C compilation but not linked
/H limit the length of external (public) Names
/Help list compiler options
/J. Change the default char type.
/Nologo cancel display logon copyright logo
/Qi0f ensure that the Pentium 0f command is correct
/Qifdiv fdiv, fprem, fptan, and fpatan instruction-defective Intel Pentium microprocessor workarounds

/Qifist Cancel the call of the Helper function _ ftol when the floating point type needs to be converted to the integer type

/Showincludes: displays the list of all included files during compilation
/TC
/TC specifies the C source file
/TP
/TP specifies the C ++ source file
/V sets the version string
/W sets the warning level
/W disable all warnings
/Wall enables all warnings, including warnings disabled by default
/WL enables single-line Diagnosis of error messages and warning messages when compiling C ++ source code from the command line
/ZM sets the compiler's memory allocation limit

==========================================

Link usage:

/Align specifies the alignment of each section
The/align option specifies the alignment of each section in the linear address space of the program. The number parameter is in bytes and must be a power of 2. The default value is 4 K (4096 ). If alignment is generated
If the image is invalid, the linker issues a warning. Unless
Compile an application such as a device driver. Otherwise, you do not need to modify the alignment mode.
/DLL generation DLL
/Driver: Create a driver in Windows NT core Mode
/Exetype generate Virtual Device Driver
/Exetype: Dynamic creates a Dynamically Loaded Virtual Device Driver.
/Exetype: dev386 creates a statically loaded Virtual Device Driver. This is the default value of/exetype.
/Incremental control incremental links
/Largeaddressaware notifies the compiler application to support addresses larger than 2 GB
/Libpath allows the user to override the Environment library path
/Libpath: "E: \ Vc \ Lib"/libpath: "E: \ DX \ Lib"
/Machine: Specify the Target Platform
'/Machine: {am33 | arm | EBC | IA64 | m32r | MIPS | mips16 | mipsfpu | mipsfp16|
Mipsr41xx | SH3 | sh3dsp | sh4 | sh5 | thumb | x86 | x64/* 8.0 */}
/Machine: x86
/Noentry create pure resource DLL
The/noentry option is required when a pure resource DLL is created.
/OPT control link optimization
If you generate components that only run on Windows NT or Windows 2000, use/OPT: nowin98.
/Subsystem: Specify the subsystem
{Console | efi_application | efi_boot_service_driver |
Efi_rom | efi_runtime_driver | native | POSIX | Windows |
WindowsCE} [, # [. #]
/Out specifies the output file name
/Out: hello.exe

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.