In-depth exploration of VC -- compiler cl.exe (2) http://blog.csdn.net/wangningyu/article/details/4837419

Source: Internet
Author: User
Tags define definition

This section describes all the vcphers. optionoptiis the compilation of cl.exeand is the most complex and commonly used cl.exe command line parameters. The following describes some common compilation options:

1. Code Generation

These options will affect the machine code generated after compilation:

 

2. debugging

Debugging-related compilation options such as/z7,/Zi,/Zi are required for program debugging, when generating a debug version program, you must specify the/OD option to disable optimization:

 

3. Program Optimization

Options related to program optimization, for example, the optimization option will affect the compiler's optimization of the code. You need to use these options, such as the minimum code size or the fastest running speed:

 

4. output files

Options related to the generated output file, for example, the input file must use a string to specify its path in the parameter. The string is enclosed by double quotation marks, for example,/FD "bin //". Note the conversion character of the string. To use a single slash to represent the file path, use the parallel bars ("//"):

 

5. pre-processor Problems

For example, Preprocessor-related options affect the running of the Preprocessor. For example, the/D option can achieve the same effect as the # define definition in the source code:

 

6. Links

For example, the compiler can debug the linker and pass call parameters to the linker. /Link option to complete this function, you can also specify the size of the stack, create a dynamic link library, and so on:

 

7. Pre-Compilation

For example, pre-compilation-related options affect the pre-compilation result:

 

8. language-related

Language-related options such as/za and/ze indicate whether Microsoft's Language extension is supported or only standard C/C ++ is supported. The/ZP option can specify the member alignment in the structure, which affects the size of the struct in the generated program. In some protocol header processing, the/ZP option is very useful:

 

9. Other options

These options have many influences and are not well classified. Including displaying help information and setting warnings.

 

This is the knowledge about VC compiler parameters and options. Of course, this is only a common option for most VC/C ++ compilers, not all of which are compiled.

(If you need to use other compiler options, please refer to msdn on your own)

 

In addition, I hope you can provide additional instructions on the shortcomings!

 

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.