The settings of the VC6.0 compiler parameters are mainly done by the VC's menu item Project-> Settings-> C / C page. We can see the content of this page of the bottom Project Options, generally as follows: / Nologo / MDD / W3 / GM / GX / Zi / OD / D "WIN32" / D "_debug" / d "_windows" / D "_Afxdll" / d "_mbcs" /fp"debug/writingdlgtest.pch "/yu"stdafx.h" / fo "debug /" / fd "debug /" / fd / gz / c "representative" / FD / GZ / C various parameters represent "can be referenced MSDN. For example, / NOLOGO indicates that the output window is not displayed in the output window (we can remove this parameter to look at the effect), etc.. Generally we do not directly modify these settings, but through the top Category in this page ...... reproduced -
Mainly passing the VC menu item
Project-> settings-> C / C page to complete. We can see the content of this page of the bottom Project Options, generally as follows:
/ NOLOGO / MDD / W3 / GM / GX / ZI / OD / D "WIN32" / D "_debug" / d "_windows" / d "_afxdll" / d "_mbCS" /fp"debug/writingdlgtest.pch "/ yu "stdafx.h" / fo "debug /" / fd "debug /" / fd / gz / c
The meaning of each parameter represents, you can refer to MSDN. For example, / NOLOGO indicates that the output window is not displayed in the output window (we can remove this parameter to look at the effect), etc.. Generally we do not directly modify these settings, but through the top Category in this page.
1)
General: Some overall settings.
WARNING LEVEL is used to control warning information, where Level 1 is the most serious level; Warnings as Errors will be warned as an error handle; Optimizations Code is optimized, you can make a thinner setting in Category's Optimizations item; Generate Browse INFO is used Generate. SBR file, record class, variable, etc. Symbol information, etc., you can make more settings in Category's Listing Files item. Debug info generates debugging information:
None, does not produce any debugging information (fast compilation); line number only generates the global and external symbol of debug information to .Obj file or .exe file, reduce the size of the target file; C 7.0-Compatible, record debugging All symbolic information for use to .obj file and .exe file; Program Database, create a .pdb file to record all debugging information; Program Database for "Edit & Continue, create a .pdb file to record all debugging information, and support debugging .
2) C Language
Pointer-to-member representation is used to set the relationship between class definitions / references:
Best-case always, indicating that this class is defined before the reference class; General-purpose always,? Point to Any Class Point to Single- and Multiple-Inheritance Classes Point to Single-Inheritance Classes Enable Exception Handling, exception handling synchronization; Enable Run-Time Type Information forces the compiler adds the object code at run time type checking; Disable Construction Displacements sets the class construction / destructor to call virtual function issues.
3)
Code generation
Processor represents the code instruction optimization, which can be used for 80386, 80486, Pentium, Pentium Pro, or Blend to indicate various optimizations above. Use run-time library is used to specify the runtime library used by the program runtime. There is a principle that one process does not use several versions of the runtime library. Connecting a single-line library does not support multi-threaded calls, connecting multi-thread libraries requires creating multi-threaded applications.
SINGLE-Threaded, single-threaded version, static connection libc.lib library; debug single-threaded, single-threaded version, static connection libcd.lib library; multithreaded, multi-thread Release version, static connection libcmt.lib library; debug multithreaded, Multi-thread Debug version, static connection libcmtd.lib library; Multithreaded DLL, dynamically connected MSVCRT.DLL library; Debug Multithreaded DLL, dynamically connect MSVCRTD.DLL libraries. Calling convention can be used to set the call convention, there are three types: __ cdecl, __ fastcall and __stdcall. The main difference between various calls is: 1. When the function is called, the parameter of the function is pressed from the left to right. The stack is pressed from the right to left; 2. When the function returns, the caller is cleaned up. The parameters of the stack are still cleaned by the function itself; 3. Naming modifications to the function name at compile time (you can see various named modifications through Listing Files). Struct Member Alignment is used to specify the member variables in the data structure in memory, and the speed of alignment data is different depending on the number of bits of the computer data bus. This parameter is especially important for applications such as packet network transmission, not access speed issues, but the accurate definition of data bits, generally using #pragma packs in the program.
4)
Customize
Disable language extensions, indicating that the language extension does not use Microsoft as standard C; Eliminate Duplicate Strings, primarily for string optimization (put strings into the slow pool to save space), use this parameter, make char * sbuffer = "This is a character buffer"; char * TBUFFER = "this is a character buffer"; SBuffer and TBuffer point to the same memory space; Enable Function-Level Linking, tell the compiler to compile each function in package format; Enables minimal Rebuild, by saving the associated information to the .IDB file, making the compiler only to recompile the latest class definition change, improve the compilation speed; Enable Incremental Compilation, the information saved by the .IDB file, only recompile the latest changes Over-function; Suppress Startup Banner and Information Messages is used to control whether the parameters are output at the Output window. 5)
Listing file
It has been mentioned above Generate Browse Info. Here you can make more settings. Exclude local variables from breakse info indicates whether the information of the local variable is placed in the .sbr file. Listing File Type can set the content of the generated list information file:
Assembly-only listing only generates a assembly code file (.asm extension); askSEMBLY with MACHINE CODE generates machine code and assembly code file (.cod extension); askSEMBLY with SOURCE CODE generates source code and assembly code file (.asm extension) ); Assembly, Machine Code, And Source generates machine code, source code, and assembly code files (.cod extensions). Listing File Name The path of the information file generated, generally for the file name that is automatically todged from the file name of the debug or release directory.
6) Optimizations code optimization settings.
Maximize Speed generates the fastest code; Minimize Size generates a minimum size program; Customize custom optimization. Customized contents include:
Assume no aliasing, do not use alias (increase speed); Assume aliasing across function calls, only the alias inside the function; Global Optimizations, global optimization, such as frequently used variables, or the calculation optimization within the loop, such as I = -100; While (i <0) {i = x y;} will be optimized to i = -100; t = x y; while (i <0) {i = T;}; generate Intrinsic functions, replace some function calls (improve speed); Improve Float Consistency, floating point operations; Favor Small Code, program (EXE or DLL) size optimization is preferred over code speed optimization; Favor Fast Code, program ( EXE or DLL) code speed optimization takes precedence over dimension optimization; Frame-Pointer Omiiss, does not use frame pointer to increase function call speed; Full Optimization, combine several parameters to generate the fastest program code. Inline function expansion, inline function extension three optimization (using inline can save functions, speed up program speed): disable, do not use inline; "Only __inline, only the function definition has inline or __inline tag in use Union; Any Suitable, in addition to the INLINE or __INLINE tag, the compiler "I think" I should use the inline function, all inline.
7)
Precompiled Headers sets the settings of the header file. Use pre-compilation to improve the speed of repeated compilation. VC typically places some public, uncommon headers (such as AfxWin.h, etc.) in Stdafx.h, this part of the code does not have to recompile each time (unless it is Rebuild All).
8) Preprocessor pre-compiled processing. You can define / unwind some constants.
Additional Include Directories, you can specify additional directorys, usually relative to the directory of this item, such as ../include.
Connection parameters set
Mainly through the VC's menu item Project-> settings-> link page. We can see the content of this page of the bottom Project Options, generally as follows:
/ NOLOGO / SUBSYSTEM: Windows / Incremental: Yes /PDB: "Debug/writingdlgtest.pdb" / debug / machine: i386 /out:"debug/writingdlgtest.exe "/ pdbtype: sept
Let's take a look at the settings in category.
1) General Some overall settings. You can set the generated file path, file name; connected library file;
Generate Debug Info generates Debug information to .pdb files (specific format can be set in category-> debug); Ignore All Default Libraries, give up all default library connections; link incrementally, through generation. ILK file implementation incremental connection to improve Subsequent connection speed, but in this way, the file (exe or dll) generated in this manner is large; Generate MapFile, generates .map file record module related information; Enable Profiling, this parameter is usually used simultaneously with the generate mapfile parameter, and if Debug is generated If information, you cannot use .pdb files, and you must use Microsoft Format. 2) Customize You can make the settings of the programs database file.
Force File Output, forcing the output file (EXE or DLL); Print Progress Messages can output progress information during the connection to the Output window.
3) Debug Set whether to generate debugging information, as well as the format of debugging information.
Dubug Info, formats can have three options for Microsoft Format, Coff Format (Common Object File Format) and Both Formats. Separate Types, indicating that the debug format information is stored separately .pdb file, or placed directly in each source file .pdb Document. In the case, it means that the latter is used, which is fast to debug startup.
4) INPUT This you can specify the library file to be connected to abandon the library files. You can also add additional library file catalogs, usually relative to the directory of this item, such as ../lib.
Force Symbol References, you can specify a library that connects specific symbol definitions.
5) OUTPUT
Base Address can change the base address of the program (EXE file defaults to 0x400000, DLL default is 0x10000000), always trying to start with this base address when the operating system is loaded. Entry-Point Symbol Specifies the entry address of the program, typically a function name (and must use the __stdcall call convention). General Win32 program, EXE's entrance is WinMain, the entry of the DLL is DLLLENTRYPOINT; it is best to let the connector automatically set the program's entry point. By default, through a C runtime library function: The console program uses MainCrtStartup (or WMAINCRTSTARTUP) to call the program's main (or wmain) function; Windows program uses WinMainCrtStartup (or wwinmaincrtstartup) calls to Winmain (or wwinmain) The __stdcall call convention must be used); the DLL uses the _dllmaincrtstartup calls the DLLMAIN function (must adopt the __stddcall call convention). Stack Allocations is used to set the stack size used by the program (please use the decimal), and the default is 1 megabyte. Version Information tells the connector to put the version number on the beginning of the EXE or DLL file.
It is worth noting that:
The above parameters are sensitive; when the parameter is added "-" indicates that the parameter is invalid; the various parameter value options have the default value of the "*" is the default value of this parameter; you can use the "reset" button in the upper right corner. Restore all default settings for this page. Other parameter settings.
1) Project-> settings-> general, you can set the way to connect the MFC library (static or dynamic). If it is a dynamic connection, do not forget the DLL of the MFC when the MFC software is released.
2) Project-> settings-> debug, you can set the executable running time when debugging, and the command line parameters, etc.
3) Project-> Settings-> Custom Build, you can automate some operations after the compilation / connection is successful. More useful is that when writing COM, I hope that VC is automatically registered with the compilation COM file, which can be set as follows:
Description: Register COM
Commands: Regsvr32 / S / C $ (TargetPath)
Echo Regsvr32 Exe.Time> $ (Targetdir) / $ (Targetname) .TRG
Outputs: $ (Targetdir) / $ (targetname) .trg
4) Tools-> Options-> Directories, set the system's include, library path.
Some tips
1) Sometimes, when you can compile, the computer suddenly illegally shuts down (maybe someone accidentally touches the power or your memory instability.). When you restart the machine, open the project, re-compile it, and find that the VC will collapse. You may think that your VC compiler is broken, it is not (you try to compile other projects, or good!), You only need to put the project's .ncb, .opt, .aps, .clw file and debug, release directory All files are deleted and then recompiled.
2) If you want to share your source code project with others, it is too big to copy the entire project. You can delete the following files: .dsw, .ncb, .opt, .aps, .clw, plg file, and debug, all files in the release directory.
3) When you contain multiple project in your workspace, you may not be intuitive, which one is the current project. You can set it as follows: Tools-> Options-> Format, then select Workspace Window in Category to change its default font (such as Fixedsys).
4) How to change the existing Project? Turn it off. Then open the .dsp file in the text format, replace the original Project name.
5) VC6 is useful for the smart prompt function of class members, but sometimes it will fail. You can turn off the project first, remove .clw and .ncb, then reopen the project, click on the menu item View-> ClassWizard, press "Add All" button in the pop-up dialog; re-rebuild all. You should solve the problem