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!