The Project command displays a dialog box that controls options for compiling and linking programs.
·To set project options:
1.From the Options menu, choose Project. The Project dialog box appears.
2.Choose a program type from the Program Type box.
3.Choose the appropriate mode (Debug or Release) from the Build Mode box.
4.Choose from Customize Build Options to set additional compiler, linker, and resource options.
5.Choose OK.
All of the options are discussed below.
The Program Type options let you select what type of program to build. The
options include:
Windows EXE. An executable file that uses Windows routines. An executable (.EXE) file is a set of instructions a computer can read. A compiler takes your program source code and translates (compiles and links) it into machine code.
These programs can run only under Windows.
Windows DLL. An executable file containing dynamic-link library (DLL) routines accessible to a Windows executable file. Dynamic-link library routines are not linked to the executable file. Instead, they are loaded into memory when the .EXE file is run. The .EXE file can then call routines in the .DLL file.
QuickWin EXE. A Windows executable file that provides a window for standard C input/output routines.
DOS EXE. A character-based executable file that can run under DOS or Windows.
You can build a program as a debug or release version.
The Debug option creates files for use by the Windows Graphical Development Environment debugger or the Microsoft CodeView debugger.
The Release option creates files without debugging information. Release versions are typically smaller and faster.
The Customize Build Options box contains buttons that display dialog boxes for setting compiler, linker, and resource compiler options.
C compiler, linker, and Resource Compiler options are described in the following sections.
The Compiler button in the Project dialog box displays a dialog box that controls options for the C compiler.
This box sets options that apply to the entire program, regardless of build mode or program type.
Memory Model
The Memory Model option specifies how code and data are organized in memory. Use the drop-down list box to specify the memory model. Memory models include:
Small
All function calls and all data pointers are near (code and data each in a single segment).
Medium
All functions calls are far (code in multiple segments) and all data pointers are near (data in one segment).
Compact
All function calls are near (code in one segment) and all data pointers are far (data in multiple segments).
Large
All function calls and all data pointers are far (code and data in multiple segments). Each data item must fit in a single segment.
Warning Level
You can choose any of four levels of warning messages, ranging from level 0 (no warnings) to level 4 (maximum). Level 3 is the default.
If you intend to move your C program to another computer or compiler, you may want special treatment of nonstandard language features. Options include:
ANSI Compatible
Flags all code that does not conform to the ANSI standard for C.
MS Extensions
Uses Microsoft language extensions without warnings. Microsoft extensions include additional keywords such as _cdecl, _fortran, and _near; single-line comments; and mixed character and string constants in initializers. This is the default setting.
The Debug Options control debug builds. These options are active only when you have selected the Debug build mode. The options include:
CodeView Info
Puts symbolic debugging information in the object file. Use this option if you are debugging with the Microsoft CodeView debugger or the integrated Windows Graphical Development Environment debugger.
Pointer Check
Generates run-time code that checks for null or out-of-range pointers. Using this option may slow execution, but it can prevent serious errors.
Incremental Compile
Compiles only changed routines.
The Release Options control release builds. They are active only when you have selected the Release build mode. The options include:
Optimizations
For Windows programs, optimization decreases program size but may also decrease program speed. For DOS programs, optimization increases execution speed but may increase code size. Full optimization optimizes loops.
Suppress Stack Check
Stack checking calls a stack probe routine upon entry to each function. The stack probe checks that the stack has enough space for the function's local variables. Use stack checking while debugging to catch stack-overflow errors. Turn it off in release versions for smaller, faster code.
The Options button expands the dialog box and presents the following additional custom options.
Custom Options
You can use the Custom Options section for any other command-line options you need. Entries in the Global text box apply to both debug and release versions of the program. For entering commands specific to a debug or release version, use the appropriate text box. For a list of command-line options, see the Toolkit or online help.
Defines
You define macros and constants in this text box.
The default compiler options are set to the options listed in the following table.
C Default Options
Windows EXE | Windows DLL | QuickWin EXE | DOS EXE |
Memory Model | Small | Small | Small | Small |
Warning Level | 3 | 3 | 3 | 2 |
CodeView Info | Yes | Yes | Yes | Yes |
Pointer Check | No | No | No | Yes |
Incremental Compile | Yes | Yes | Yes | Yes |
Optimize | Yes | Yes | Yes | Yes |
Suppress Stack Check | Yes | Yes | Yes | Yes |
Global Flags | /Gw /Zp | /Gw /Zp /Aw | /Gw | — |
The Linker button in the Project dialog box displays a dialog box that controls the options for the linker.
The Global Options box applies to both debug and release builds. Options include:
Ignore Case
Toggles case sensitivity.
Extended Dictionary
Tells the linker to search extended dictionaries in libraries when resolving references.
Ignore Default Library
Prevents the linker from using the default C run-time libraries. This option should not be checked if you want the environment to provide the default run-time library names to the linker. To provide additional library names to the linker, add them to your project file using the Edit Project dialog box.
Alignment
Sets the alignment for segments. A Windows .EXE file is aligned on a 16-byte boundary. This option is unavailable in a DOS EXE Project.
Stack Size
Sets the stack size. If the program type is Windows, the default stack size is 5120 bytes. If you are building a DOS program, the default stack size is 2048 bytes. The number entered here overrides the size given by the stack segment in your program. The size can be any even value up to 64K.
The Debug Options box applies only to debug builds. Options include:
CodeView Info
Adds symbolic information to the .EXE file. To take advantage of this option, you must include CodeView Info in the object files from the compiler.
CV 3.X Format
Formats symbolic debugging information for Microsoft CodeView versions 3.x, including CVW 3.0. Do not select this option if you intend to use the Graphical Development Environment debugger. This option is unavailable if the CodeView Info option described above is not selected.
Map File
Creates a listing of segments in the program. The map file is given the same name as the program and the extension .MAP. You can use the Open command from the File menu to load and view the map file.
The Options button expands the dialog box and displays the Custom Options linker options.
Use the Custom Options section for any other command-line options you need. Entries in the Global text box apply to both debug and release versions of the program. To enter options specific to the debug and release versions, use the Debug and Release text boxes. For a list of command-line options, see the Toolkit or online help.
The Resources button from the Project dialog box displays a dialog box that controls options for the Resource Compiler. For more information on the RC Resource Compiler see the Toolkit.
The options available with the Customize Resource Options dialog box are as follows:
Search Include Files Path
Searches for resource files in the path listed in the Graphical Development Environment.
Windows Protect Mode only
Sets the –T Resource Compiler option to create an application that runs only with Windows in protected mode.
Disable Load-Optimization
Disables the load-optimization feature of the Resource Compiler.
When the Resource Compiler optimizes a load, it arranges segments and resources so that all preloaded information in the executable file is contiguous. Windows can then load the application more quickly. All data segments, nondiscardable code segments, and the entry-point code segment will be preloaded, as long as the segment in question doesn't exceed 64K.
Resources and segments will have the same segment alignment. The alignment should be as small as possible to prevent the final executable file from growing unnecessarily large. You can set the alignment in the Customize Linker Options dialog box.
Custom Options
Used for specifying other Resource Compiler options.
Defines
Used for specifying Resource Compiler defines.