VS2010 编译器总结

 

General Property Page (Project)

When you right-click on a project node in in Solution Explorer, and select Properties, the General property page under the Configuration Properties node in the left pane displays two sections of properties:

  • General

  • Project Defaults

General

The properties in the General section affect the location of files that are created in the build process and which files to delete when the Clean option (Build menu) is selected.

  • Output Directory
    Specifies the directory where tools such as the linker will place all final output files that are created during the build process. Typically, this includes the output of tools such as the linker, librarian, or BSCMake.

    To programmatically access this property, see OutputDirectory.

  • Intermediate Directory
    Specifies the directory where tools such as the compiler will place all intermediate files created during the build process. Typically, this includes the output of tools such as the C/C++ compiler, MIDL, and the resource compiler.

    To programmatically access this property, see IntermediateDirectory.

  • Target Name
    Specifies the file name this project generates.

  • Target Extension
    Specifies the file name extension this project generates; for example, .exe or .dll.

  • Extensions to Delete on Clean
    The Clean option (Build menu) deletes files from the intermediate directory where a project's configuration is built. Files with extensions specified with this property will be deleted when Clean is run or when you perform a rebuild. In addition to files of these extensions in the intermediate directory, the build system will also delete any known output of the build regardless of where it is located (including intermediate outputs such as .obj files). Note that you can specify wildcard characters.

    To programmatically access this property, see DeleteExtensionsOnClean.

  • Build Log File
    Allows you to specify a non-default location for the log file that is created whenever you build a project.

    You can use project macros to change the directory location. See Macros for Build Commands and Properties.

  • Platform Toolset
    Allows the project to target a different version of the Visual C++ libraries and compiler. Visual C++ projects can target either the default toolset in Visual Studio 2012 (v100) or the toolset that creates executables that can run on Windowx XP.

Project Defaults

The properties in the Project Default section represent default properties that you can modify. The definition for these properties can be found in the .props files in Installation Directory\VC\VCProjectDefaults.

    • Configuration Type
      There are several configuration types from which to choose:

      • Application (.exe), displays linker toolset (C/C++ Compiler, MIDL, Resource Compiler, Linker, BSCMake, XML Web Service Proxy Generator, custom build, prebuild, prelink, postbuild events).

      • Dynamic Library (.dll), displays linker toolset, specifies /DLL linker option, and adds the _WINDLL define to CL.

      • Makefile, displays makefile toolset (NMake).

      • Static Library (.lib), displays librarian toolset (same as linker toolset except substitute librarian for linker and omit XML Web Service Proxy Generator).

      • Utility, displays utility toolset (MIDL, custom build, prebuild, postbuild events).

      To programmatically access this property, see ConfigurationType.

    • Use of MFC
      Specifies whether the MFC project will statically or dynamically link to the MFC DLL. Non-MFC projects can select Use Standard Windows Libraries to link to various Win32 libraries that are included when you use MFC.

      To programmatically access this property, see useOfMfc.

    • Use of ATL
      Specifies whether the ATL project will statically or dynamically link to the ATL .DLL. If you specify anything other than Not Using ATL, a define will be added to the compiler's Command Line property page.

      To programmatically access this property, see useOfATL.

    • Character Set
      Defines whether _UNICODE or _MBCS should be set. Also affects the linker entry point where appropriate.

      To programmatically access this property, see CharacterSet.

    • Common Language Runtime support
      Causes the /clr compiler option to be used.

      To programmatically access this property, see ManagedExtensions.

    • Whole Program Optimization
      Specifies the /GL compiler option and /LTCG linker option.

    • Windows Store App Support
      Specifies whether this project supports Windows Store apps. For more information, see /ZW (Windows Runtime Compilation), and the Windows Developer Center.

 

 

Project Settings for a C++ Debug Configuration

You can change the project settings for a C or Visual C++ debug configuration in the Property Pages dialog box, as discussed in How to: Set Debug and Release Configurations. The following tables show where to find debugger-related settings in the Property Pages dialog box.

 Warning

The debug project settings in the Configuration Properties/Debugging category for Windows Store apps and components that are written in C++ are different. See How to start a debugging session (Visual C++, Visual C#, and Visual Basic) in the Windows Development Center.

Specify which debugger to use in the Debugger to launch list box. Your choice will affect which properties are visible.

Each debug property setting is automatically written and saved to the "per-user" file (.vcxproj.user) for your solution whenever you save your solution.

Configuration Properties folder (Debugging category)

Setting

Description

Debugger to launch

Specifies the debugger to run, with the following choices:

  • Local Windows Debugger

  • Remote Windows Debugger

  • Web Browser Debugger

  • Web Service Debugger

Command (Local Windows Debugger)

Specifies the command for starting the program that you are debugging on the local computer.

Remote Command (Remote Windows Debugger)

The path for the .exe on the remote computer. Enter the path just as you would enter it on the remote machine.

Command Arguments (Local Windows Debugger and Remote Windows Debugger)

  • Specifies arguments for the command specified earlier.

You can use the following redirection operators in this box:

< file

Reads stdin from file.

> file

Writes stdout to file.

>> file

Appends stdout to file.

2> file

Writes stderr to file.

2>> file

Appends stderr to file.

2> &1

Sends stderr (2) output to same location as stdout (1).

1> &2

Sends stdout (1) output to same location as stderr (2).

In most cases, these operators are applicable only to console applications.

Working Directory

Specifies the working directory of the program being debugged, relative to the project directory where your EXE is located. If you leave this blank, the working directory is the project directory. For remote debugging, the project directory will be on the remote server.

Attach (Local Windows Debugger and Remote Windows Debugger)

Specifies whether to start or attach to the application. Default setting is No.

Remote Server Name (Remote Windows Debugger)

Specifies the name of a computer (other than yours) on which you want to debug an application or an Msvsmon server name. You can also select this from the Processes dialog box (for more information, see Selecting a Remote Machine). If you specify the computer name here, you must also specify the connection type in Connection.

The RemoteMachine Build macro is set to the value of this property; for more information, see Macros for Build Commands and Properties.

Connection (Remote Windows Debugger)

Allows you to switch between standard and no-authentication connection types for remote debugging. Specify a remote computer name in the Remote Server Name box. Connection types include the following:

  • Remote with Windows Authentication

  • Remote with No Authentication (Native Only)

Note   Remote debugging with No Authentication may leave the remote computer vulnerable to security violations. Windows Authentication mode is more secure.

For more information, see Remote Debugging Setup.

HTTP URL (Web Service Debugger and Web Browser Debugger)

Specifies the URL where the project you are debugging is located.

Debugger Type

Specifies the type of debugger to be used: Native Only, Managed Only, GPU Only, Mixed, Auto (default), or Script.

  • Native Only is for unmanaged C++ code.

  • Managed Only is for code that runs under the common language runtime (managed code).

  • Mixed invokes debuggers for both managed and unmanaged code.

  • Auto determines the debugger type based on compiler and EXE information.

  • Script invokes a debugger for scripts.

  • GPU Only is for C++ AMP code that runs on a GPU device or on the DirectX reference rasterizer.

Environment (Local Windows Debugger)

Specifies environment variables for the program that you are debugging. Use standard environment variable syntax (for example, PATH="%SystemRoot%\..."). These variables override the system environment or are merged with the system environment, depending on the Merge Environment setting. When you click in the settings column, an "Edit…" appears. Click that link to edit environment variables.

Merge Environment (Local Windows Debugger)

Determines whether the variables that are specified in the Environment box will be merged with the environment that is defined by the operating system. Default setting is Yes.

SQL Debugging (all but MPI Cluster Debugger)

Enables debugging of SQL procedures from your Visual C++ application. Default setting is No.

Debugging Accelerator Type (GPU debugging only)

Specifies the GPU device to use for debugging. Installing device drivers for compatible GPU devices will add additional options. The default setting is "GPU - Software Emulator."

GPU Default Breakpoint Behavior (GPU debugging only)

Specifies whether a breakpoint event should be raised for each thread in a SIMD warp. The default setting is to raise the breakpoint event only once per warp.

Deployment Directory (Remote Windows Debugger)

Specifies the path on the remote computer where the project output will be copied prior to launch. The path can be a network share on the remote computer, or it can be a path to a folder on the remote computer. The default setting is empty, which means the project output is not copied to a network share. To enable deployment of the files, you must also select the Deploy check box in the Configuration Manager dialog box. For more information, see How to: Create and Edit Configurations.

Additional Files to Deploy (Remote Windows Debugger)

If the Deployment Directory property is set, this is a semi-colon delimited list of additional files to copy to the deployment directory. The default setting is empty, which means that no additional files are copied to the deployment directory. To enable deployment of the files, you must also select the Deploy check box in the Configuration Manager dialog box. For more information, see How to: Create and Edit Configurations.

Deploy Visual C++ Debug Runtime Libraries (Remote Windows Debugger)

If the Deployment Directory property is set, this specifies whether the Visual C++ debug runtime libraries for the current platform should be copied to the network share. The default setting is Yes.

C/C++ folder (General category)

Setting

Description

Debug Information Format (/Z7, /Zd, Zi, /ZI)

Specifies the type of debug information to be created for the project.

The default option (/ZI) creates a program database (PDB) in Edit and Continue compatible format. For more information, see /Z7, /Zd, /Zi, /ZI (Debug Information Format).

For more information, see PDB Files and DBG Files

C/C++ folder (Optimization category)

Setting

Description

Optimization

Specifies whether the compiler should optimize the code it produces. Optimization changes the code that is executed. Optimized code no longer matches the source code. Therefore, debugging is difficult.

The default option (Disabled (/0d) suppresses optimization. You can develop with optimization suppressed, and then turn it on when you create the production version of your code.

Linker folder (Debugging category)

Setting

Description

Generate Debug Info (/DEBUG)

Tells the linker to include debug information, which will have the format specified by /Z7, /Zd, Zi, or /ZI.

Generate Program Database File (/PDB:name)

Specify the name of a PDB file in this box. You must select ZI or /Zi for Debug Information Format.

Strip Private Symbols (/PDBSTRIPPED:filename)

Specify the name of a PDB file in this box if you do not want to include private symbols in the PDB file. This option creates a second program database (PDB) file when you build your program image with any of the compiler or linker options that generate a PDB file, such as /DEBUG, /Z7, /Zd. Or /Zi. This second PDB file omits symbols that you would not want to ship to your customers. For more information, see /PDBSTRIPPED (Strip Private Symbols).

Generate Map File (/MAP)

Tells the linker to generate a map file during linking. Default setting is No. For more information, see /MAP (Generate Mapfile).

Map File Name(/MAP:name)

If you choose Generate Map File, you can specify the map file in this box. For more information, see /MAP (Generate Mapfile).

Map Exports (/MAPINFO:EXPORTS)

Includes exported functions in the map file. Default setting is No. For more information, see /MAPINFO (Include Information in Mapfile).

Debuggable Assembly (/ASSEMBLYDEBUG)

Specifies settings for the Linker /ASSEMBLYDEBUG option. Possible values are as follows:

  • No debuggable attribute emitted.

  • Runtime tracking and disable optimizations (/ASSEMBLYDEBUG). This is the default setting,

  • No runtime tracking and enable optimizations(/ASSEMBLYDEBUG:DISABLE).

  • <inherit from parent or project defaults>.

  • For more information, see /ASSEMBLYDEBUG (Add DebuggableAttribute).

You can change these settings in the Configuration Properties folder (Debug category) programmatically by using the Microsoft.VisualStudio.VCProjectEngine.VCDebugSettings interface. For more information, see VCDebugSettings.

See Also

Reference

/ASSEMBLYDEBUG (Add DebuggableAttribute)

Other Resources

Debugging Native Code

Debug Settings and Preparation

Creating and Managing Visual C++ Projects

Macros for Build Commands and Properties

 

 

 

 

VC++ Directories Property Page

Enables you to specify semicolon-delimited lists of directories that Visual Studio uses to build the current project. You access this property sheet by selecting Project | Properties and then expanding the Configuration Properties node in the left pane.

 Important

To see these options in Microsoft Visual C++ Express 2010, select Tools > Settings > Expert Settings.

Many directories in the list are given as macros. To see the current value of any macro, select a row, for example Include Directories, then click on the drop-down arrow on the right and choose <Edit>. In the dialog that pops up, click on the Macros button to see the current value.

For more information, see the following blog posts: VC++ DirectoriesInherited Properties and Property Sheets and Visual Studio 2010 C++ Project Upgrade Guide.

Directory Types

You can specify the following directory types.

  • Executable Directories
    Directories to search for executable files. Corresponds to the PATH environment variable.

  • Include Directories
    Directories to search for include files that are referenced in the source code. Corresponds to the INCLUDE environment variable.

  • Reference Directories
    Directories to search for assembly and module (metadata) files that are referenced in the source code by the #using directive. Corresponds to the LIBPATH environment variable.

  • Library Directories
    Directories to search for libraries (.lib files) including run-time libraries. Corresponds to the LIB environment variable. This setting does not apply to .obj files; to link to an .obj file, use the Additional Dependencies setting on the Linker Property Pages and specify the relative path to the file.

  • Source Directories
    Directories to search for source files to use for IntelliSense.

  • Exclude Directories
    Directories not to search when checking for build dependencies.

To specify a per-project directory list

  1. On the Project menu, click Properties.

  2. In the Property Pages dialog box, click Configuration Properties and then click VC++ Directories.

  3. To edit one of the directory lists, click its name, click the arrow that appears, and then click Edit to open a dialog box for the selected directory type.

    You can add or remove values, and you can reorder any values that have been added. You can also select or clear Inherit from parent or project defaults.

     Note

    By default, projects created by using Visual Studio inherit standard directory lists.

Remarks

Use project property sheets to set up directory search paths for projects that can be shared by other users or that can be applied across multiple computers. For more information, see Property Sheets (C++).

 

 

 

 

Linker Property Pages

This topic discusses the following properties on the General linker property page:

  • Ignore Import Library
    Tells the linker not to try to link any .lib output generated from this build into any dependent project. This allows the project system to handle .dll files that do not produce a .lib file when built. If a project depends on another project that produces a DLL, the project system automatically will link the .lib file produced by that child project. This may not be needed by projects that are producing COM DLLs or resource-only DLLs; these DLLs do not have any meaningful exports. If a DLL has no exports, the linker will not generate a .lib file. If no export .lib file is present on the disk, and the project system tells the linker to link with this (missing) DLL, the link will fail.

    Use Ignore Import Library to resolve this problem. When set to Yes, the project system will ignore the presence or absence of that .lib file and cause any project that depends on this project to not link with the nonexistent .lib file.

    To programmatically access this property, see IgnoreImportLibrary.

  • Register Output
    Run regsvr32.exe /s $(TargetPath), which is valid only on .dll projects. For .exe projects, this property is ignored. If you want to register an .exe output, set a postbuild event on the configuration to do the custom registration that is always required for registered .exe files.

    To programmatically access this property, see RegisterOutput.

  • Per-user Redirection
    Registration in Visual Studio has traditionally been done in HKEY_CLASSES_ROOT (HKCR). With Windows Vista, to access HKCR you must run Visual Studio in elevated mode. Developers do not always want to run in elevated mode but still must work with registration. Per-user redirection allows you to register without having to run in this mode.

    Per-user redirection will force any writes to HKCR to be redirected to HKEY_CURRENT_USER (HKCU). If per-user redirection is turned off, it can cause Project Build Error PRJ0050 when the program tries to write to HKCR.

  • Link Library Dependencies
    Gives you the choice of linking in the .lib files that are produced by dependent projects. Typically, you will want to link in the .lib file.

    You can also specify a .obj file by providing the file name and relative path, for example ..\..\MyLibProject\MyObjFile.obj. If the source code for the .obj file #includes a precompiled header, for example pch.h, then pch.obj file is located in the same folder as MyObjFile.obj and you must also add pch.obj as an additional dependency.

  • Use Library Dependency Inputs
    In a large project, when a dependent project produces a .lib file, incremental linking is disabled. If there are many dependent projects that produce .lib files, building the application can take a long time. When this property is set to Yes, the project system links in the .obj files for .libs produced by dependent projects, thus enabling incremental linking.

For information about how to access the General linker property page, see How To: Specify Project Properties with Property Pages.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C/C++ Property Pages

The following property pages are found under Project > Properties > Configuration Properties > C/C++:

C/C++ General Properties

Additional Include Directories

Specifies one or more directories to add to the include path. Separate directories with semi-colons (';') if there's more than one. Sets the /I (Additional include directories) compiler option.

Additional #using Directories

Specifies one or more directories to search to resolve names passed to a #using directive. Separate directories with semi-colons (';') if there's more than one. Sets the /AI compiler option.

Additional BMI Directories

Specifies one or more directories to search to resolve names passed to an import directive. Separate directories with semi-colons (';') if there's more than one. Sets the /ifcSearchDir[path] compiler option.

Additional Module Dependencies

Specifies one or more modules to use to resolve names passed to an import directive. Separate directories with semi-colons (';') if there's more than one. Sets the /reference compiler option.

Additional Header Unit Dependencies

Specifies one or more header units to use to resolve names passed to an import header directive. Separate directories with semi-colons (';') if there's more than one. Sets the /headerUnit compiler option.

Scan Sources for Module Dependencies

When set to Yes, the compiler scans all C++ sources, not just module interface and header unit sources, for module and header units dependencies. The build system builds the full dependencies graph, which ensures that all imported modules and header units are built before compiling the files that depend on them. When combined with Translate Includes to Imports, any header file that's specified in a header-units.json file in the same directory as the header file is compiled into a header unit.

Files that have the extension .ixx, and files that have their File properties > C/C++ > Compile As property set to Compile as C++ Header Unit (/export), are always scanned.

Translate Includes to Imports

When set to Yes, the compiler treats a #include directive as an import directive if certain conditions are met: The header file is specified in a header-units.json file in the same directory, and a compiled header unit (an .ifc file) is available for the header file. Otherwise, the header file is treated as a normal #include. The header-units.json file is used to build header units for each #include without symbol duplication. When combined with Scan Sources for Module Dependencies, the compiler automatically finds all of the header files that can be compiled into header units. This property sets the /translateInclude compiler option.

Debug Information Format

Specifies the type of debugging information generated by the compiler. This property requires compatible linker settings. Sets /Z7/Zi/ZI (Debug information format) compiler options.

Choices

  • None - Produces no debugging information, so compilation may be faster.
  • C7 compatible - Select the type of debugging information created for your program and whether this information is kept in object (.obj) files or in a program database (PDB).
  • Program Database - Produces a program database (PDB) that contains type information and symbolic debugging information for use with the debugger. The symbolic debugging information includes the names and types of variables and functions, and line numbers.
  • Program Database for Edit And Continue - Produces a program database, as described above, in a format that supports the Edit and Continue feature.

Support Just My Code Debugging

Adds supporting code for enabling Just My Code debugging in this compilation unit. Sets /JMC.

Common Language RunTime Support

Use the .NET runtime service. This switch is incompatible with some other switches; see the documentation on the /clr family of switches for details.

Choices

  • No Common Language RunTime Support - No Common Language RunTime Support
  • Common Language RunTime Support - Creates metadata for your application that can be consumed by other CLR applications. Also allows your application to consume types and data in the metadata of other CLR components.
  • Pure MSIL Common Language RunTime Support - Produces an MSIL-only output file with no native executable code, although it can contain native types compiled to MSIL.
  • Safe MSIL Common Language RunTime Support - Produces an MSIL-only (no native executable code) and verifiable output file.

Consume Windows Runtime Extension

Consume the Windows Run Time languages extensions. Sets /ZW.

Suppress Startup Banner

Suppresses the display of the sign-on banner when the compiler starts up and display of informational messages during compiling.

Warning Level

Select how strict you want the compiler to be about code errors. Sets /W0 - /W4.

Choices

  • Turn Off All Warnings - Level 0 disables all warnings.
  • Level1 - Level 1 displays severe warnings. Level 1 is the default warning level at the command line.
  • Level2 - Level 2 displays all level 1 warnings and warnings less severe than level 1.
  • Level3 - Level 3 displays all level 2 warnings and all other warnings recommended for production purposes.
  • Level4 - Level 4 displays all level 3 warnings plus informational warnings, which in most cases can be safely ignored.
  • EnableAllWarnings - Enables all warnings, including the ones disabled by default.

Treat Warnings As Errors

Treats compiler warnings as errors. For a new project, it may be best to use /WX in every compilation. Resolve all warnings to minimize hard-to-find code defects.

Warning Version

Hide warnings introduced after a specific version of the compiler. Sets /Wv:xx[.yy[.zzzzz]].

Diagnostics Format

Enables rich diagnostics, with column information and source context in diagnostic messages.

Choices

  • Caret - Provides column information in the diagnostic message. And, outputs the relevant line of source code with a caret that indicates the offending column.
  • Column Info - Additionally provides the column number within the line where the diagnostic is issued, where applicable.
  • Classic - Outputs only the prior, concise diagnostic messages with the line number.

SDL checks

Additional Security Development Lifecycle (SDL) recommended checks; includes enabling additional secure code generation features and enables extra security-relevant warnings as errors. Sets /sdl/sdl-.

Multi-processor Compilation

Enable multi-processor compilation. Sets the /MP compiler option.

Enable Address Sanitizer

Compiles and links the program with AddressSanitizer instrumentation. This property currently supports x86 and x64 target builds. Sets the /fsanitize compiler option.

C/C++ Optimization Properties

Optimization

Select option for code optimization; choose Custom to use specific optimization options. Sets /Od/O1/O2.

Choices

  • Custom - Custom optimization.
  • Disabled - Disable optimization.
  • Maximum Optimization (Favor Size) - Equivalent to /Os /Oy /Ob2 /Gs /GF /Gy
  • Maximum Optimization (Favor Speed) - Equivalent to /Oi /Ot /Oy /Ob2 /Gs /GF /Gy
  • Optimizations (Favor Speed) - Equivalent to /Oi /Ot /Oy /Ob2

Inline Function Expansion

Select the level of inline function expansion for the build. Sets /Ob.

Choices

  • Default
  • Disabled - Disables inline expansion, which is on by default.
  • Only __inline - Expands only functions marked as inline__forceinline, or __inline. Or, in a C++ member function, defined within a class declaration.
  • Any Suitable - Expands functions marked as inline or __inline and any other function that the compiler chooses. (Expansion occurs at the compiler's discretion, often referred to as auto-inlining.)

Enable Intrinsic Functions

Enables intrinsic functions. Using intrinsic functions generates faster, but possibly larger, code. Sets /Oi.

Favor Size Or Speed

Whether to favor code size or code speed; 'Global Optimization' must be turned on. Sets /Ot/Os.

Choices

  • Favor small code - Minimizes the size of EXEs and DLLs by instructing the compiler to favor size over speed.
  • Favor fast code - Maximizes the speed of EXEs and DLLs by instructing the compiler to favor speed over size. (This value is the default.)
  • Neither - No size and speed optimization.

Omit Frame Pointers

Suppresses creation of frame pointers on the call stack.

Enable Fiber-Safe Optimizations

Enables memory space optimization when using fibers and thread local storage access. Sets /GT.

Whole Program Optimization

Enables cross-module optimizations by delaying code generation to link time. Requires the linker option Link Time Code Generation. Sets /GL.

C/C++ Preprocessor Properties

Preprocessor Definitions

Defines preprocessing symbols for your source file.

Undefine Preprocessor Definitions

Specifies one or more preprocessor undefines. Sets /U.

Undefine All Preprocessor Definitions

Undefine all previously defined preprocessor values. Sets /u.

Ignore Standard Include Paths

Prevents the compiler from searching for include files in directories specified in the INCLUDE environment variables.

Preprocess to a File

Preprocesses C and C++ source files, and writes the preprocessed output to a file. This option suppresses compilation, and it doesn't produce an .obj file.

Preprocess Suppress Line Numbers

Preprocess without #line directives.

Keep Comments

Suppresses comment strip from source code; requires setting at least one of the Preprocessing options. Sets /C.

C/C++ Code Generation Properties

Enable String Pooling

The compiler creates only one read-only copy of identical strings in the program image. It results in smaller programs, an optimization called string pooling/O1/O2, and /ZI automatically set /GF option.

Enable Minimal Rebuild

Enables minimal rebuild, which determines whether to recompile C++ source files that include changed C++ class definitions, stored in header .h files.

Enable C++ Exceptions

Specifies the model of exception handling to be used by the compiler.

Choices

  • Yes with SEH Exceptions - The exception-handling model that catches asynchronous (structured) and synchronous (C++) exceptions. Sets /EHa.
  • Yes - The exception-handling model that catches C++ exceptions only and tells the compiler to assume that extern C functions never throw a C++ exception. Sets /EHsc.
  • Yes with Extern C functions - The exception-handling model that catches C++ exceptions only and tells the compiler to assume that extern C functions do throw an exception. Sets /EHs.
  • No - No exception handling.

Smaller Type Check

Enable checking for conversion to smaller types, incompatible with any optimization type other than debug. Sets /RTCc.

Basic Runtime Checks

Enable basic runtime error checks, incompatible with any optimization type other than debug. Sets /RTCs/RTCu/RTC1.

Choices

  • Stack Frames - Enables stack frame run-time error checking.
  • Uninitialized variables - Reports when a variable is used without having been initialized.
  • Both (/RTC1, equiv. to /RTCsu) - Equivalent of /RTCsu.
  • Default - Default runtime checks.

Runtime Library

Specify runtime library for linking. Sets /MT/MTd/MD/MDd.

Choices

  • Multi-threaded - Causes your application to use the multithread, static version of the run-time library.
  • Multi-threaded Debug - Defines _DEBUG and _MT. This option also causes the compiler to place the library name LIBCMTD.lib into the .obj file so that the linker will use LIBCMTD.lib to resolve external symbols.
  • Multi-threaded DLL - Causes your application to use the multithread- and DLL-specific version of the run-time library. Defines _MT and _DLL and causes the compiler to place the library name MSVCRT.lib into the .obj file.
  • Multi-threaded Debug DLL - Defines _DEBUG_MT, and _DLL and causes your application to use the debug multithread- and DLL-specific version of the run-time library. It also causes the compiler to place the library name MSVCRTD.lib into the .obj file.

Struct Member Alignment

Specifies 1, 2, 4, or 8-byte boundaries for struct member alignment. Sets /Zp.

Choices

  • 1 Byte - Packs structures on 1-byte boundaries. Same as /Zp.
  • 2 Bytes - Packs structures on 2-byte boundaries.
  • 4 Bytes - Packs structures on 4-byte boundaries.
  • 8 Bytes - Packs structures on 8-byte boundaries (default).
  • 16 Bytes - Packs structures on 16-byte boundaries.
  • Default - Default alignment settings.

Security Check

The Security Check helps detect stack-buffer over-runs, a common attempted attack upon a program's security.

Choices

  • Disable Security Check - Disable Security Check. Sets /GS-.
  • Enable Security Check - Enable Security Check. Sets /GS.

Control Flow Guard

Guard security check helps detect attempts to dispatch to illegal block of code.

Choices

  • Yes - Enable Security Check with Guard Sets /guard:cf.
  • No

Enable Function-Level Linking

Allows the compiler to package individual functions in the form of packaged functions (COMDATs). Required for edit and continue to work. Sets /Gy.

Enable Parallel Code Generation

Allows the compiler to generate parallel code for loops identified using #pragma loop(hint_parallel[(n)]) when optimization is enabled.

Enable Enhanced Instruction Set

Enable use of instructions found on processors that support enhanced instruction sets. For example, the SSE, SSE2, AVX, and AVX2 enhancements to IA-32. And, the AVX and AVX2 enhancements to x64. Currently /arch:SSE and /arch:SSE2 are only available when building for the x86 architecture. If no option is specified, the compiler will use instructions found on processors that support SSE2. Use of enhanced instructions can be disabled with /arch:IA32. For more information, see /arch (x86)/arch (x64), and /arch (ARM).

Choices

  • Streaming SIMD Extensions - Streaming SIMD Extensions. Sets /arch:SSE
  • Streaming SIMD Extensions 2 - Streaming SIMD Extensions 2. Sets /arch:SSE2
  • Advanced Vector Extensions - Advanced Vector Extensions. Sets /arch:AVX
  • Advanced Vector Extensions 2 - Advanced Vector Extensions 2. Sets /arch:AVX2
  • No Enhanced Instructions - No Enhanced Instructions. Sets /arch:IA32
  • Not Set - Not Set.

Floating Point Model

Sets the floating point model. Sets /fp:precise/fp:strict/fp:fast.

Choices

  • Precise - Default. Improves the consistency of floating-point tests for equality and inequality.
  • Strict - The strictest floating-point model. /fp:strict causes fp_contract to be OFF and fenv_access to be ON. /fp:except is implied and can be disabled by explicitly specifying /fp:except-. When used with /fp:except-/fp:strict enforces strict floating-point semantics but without respect for exceptional events.
  • Fast - Creates the fastest code in most cases.

Enable Floating Point Exceptions

Reliable floating-point exception model. Exceptions will be raised immediately after they're triggered. Sets /fp:except.

Create Hotpatchable Image

When hotpatching is on, the compiler ensures that first instruction of each function is two bytes, as required for hot patching. Sets /hotpatch.

Spectre Mitigation

Spectre mitigations for CVE 2017-5753. Sets /Qspectre.

Choices

  • Enabled - Enable Spectre mitigation feature for CVE 2017-5753
  • Disabled - Not Set.

C/C++ Language Properties

Disable Language Extensions

Suppresses or enables language extensions. Sets /Za.

Conformance mode

Enables or suppresses conformance mode. Sets /permissive-.

Treat wchar_t As Built in Type

When specified, the type wchar_t becomes a native type that maps to __wchar_t in the same way that short maps to __int16/Zc:wchar_t is on by default.

Force Conformance in For Loop Scope

Implements standard C++ behavior for the for statement loops with Microsoft extensions. Sets /Za/Ze (Disable language extensions/Zc:forScope is on by default.

Remove unreferenced code and data

When specified, the compiler no longer generates symbol information for unreferenced code and data.

Enforce type conversion rules

Used to identify an rvalue reference type as the result of a cast operation according to the C++11 standard.

Enable Run-Time Type Information

Adds code for checking C++ object types at run time (runtime type information, or RTTI). Sets /GR/GR-.

Open MP Support

Enables OpenMP 2.0 language extensions. Sets /openmp.

C++ Language Standard

Determines the C++ language standard the compiler enables. The default value doesn't set a standard option, so the compiler uses its default C++14 setting. If you select a specific value, the corresponding /std compiler option is set.md).

Choices

  • Default (ISO C++14 Standard)
  • ISO C++14 Standard (/std:c++14)
  • ISO C++17 Standard (/std:c++17)
  • ISO C++20 Standard (/std:c++20)
  • Preview - Features from the Latest C++ Working Draft (/std:c++latest)

Enable C++ Modules (experimental)

Experimental support for the C++ Modules TS and Standard Library modules.

C/C++ Precompiled Headers Properties

Create/Use Precompiled Header

Enables creation or use of a precompiled header during the build. Sets /Yc/Yu.

Choices

  • Create - Instructs the compiler to create a precompiled header (.pch) file that represents the state of compilation at a certain point.
  • Use - Instructs the compiler to use an existing precompiled header (.pch) file in the current compilation.
  • Not Using Precompiled Headers - Not using precompiled headers.

Precompiled Header File

Specifies header file name to use when creating or using a precompiled header file. Sets /Yc/Yu.

Precompiled Header Output File

Specifies the path or name of the generated precompiled header file. Sets /Fp.

C/C++ Output Files Properties

Expand Attributed Source

Create listing file with expanded attributes injected into source file. Sets /Fx.

Assembler Output

Specifies the contents of assembly language output file. Sets /FA/FAc/FAs/FAcs.

Choices

  • No Listing - No listing.
  • Assembly-Only Listing - Assembly code; .asm
  • Assembly With Machine Code - Machine and assembly code; .cod
  • Assembly With Source Code - Source and assembly code; .asm
  • Assembly, Machine Code and Source - Assembly, machine code and source code; .cod

Use Unicode For Assembler Listing

Causes the output file to be created in UTF-8 format.

ASM List Location

Specifies relative path or name for ASM listing file; can be file or directory name. Sets /Fa.

Object File Name

Specifies a name to override the default object file name; can be file or directory name. Sets /Fo.

Program Database File Name

Specifies a name for a compiler-generated PDB file; also specifies base name for the required compiler-generated IDB file; can be file or directory name. Sets /Fd.

Generate XML Documentation Files

Specifies that the compiler should generate XML documentation comment files (.XDC). Sets /doc.

XML Documentation File Name

Specifies the name of the generated XML documentation files; can be file or directory name. Sets /doc:<name>.

C/C++ Browse Information Properties

Enable Browse Information

Specifies level of browse information in .bsc file. Sets /FR.

Browse Information File

Specifies optional name for browser information file. Sets /FR<name>.

External Includes

Treat Files Included with Angle Brackets as External

Specifies whether to treat files included with angle brackets as external. Set this property to Yes to set the /external:anglebrackets compiler option.

External Header Warning Level

Select how strict you want the compiler to be about code errors in external headers. This property sets the /external:Wn compiler option. If this value is set to Inherit Project Warning Level or the default, other /external options are ignored.

Template Diagnostics in External Headers

Specifies whether to evaluate the warning level across a template instantiation chain. Set this property to Yes to set the /external:templates- compiler option.

Disable Code Analysis for External Headers

Disables code analysis for external headers. Sets the /analyze:external- compiler option.

Analysis Ruleset for External Headers

Specifies a code analysis ruleset override for external headers. If not specified, the Code Analysis setting is used. Sets the /analyze:external:ruleset path compiler option.

C/C++ Advanced Properties

Calling Convention

Select the default calling convention for your application (can be overridden by function). Sets /Gd/Gr/Gz/Gv.

Choices

  • __cdecl - Specifies the __cdecl calling convention for all functions except C++ member functions and functions marked __stdcall or __fastcall.
  • __fastcall - Specifies the __fastcall calling convention for all functions except C++ member functions and functions marked __cdecl or __stdcall. All __fastcall functions must have prototypes.
  • __stdcall - Specifies the __stdcall calling convention for all functions except C++ member functions and functions marked __cdecl or __fastcall. All __stdcall functions must have prototypes.
  • __vectorcall - Specifies the __vectorcall calling convention for all functions except C++ member functions and functions marked __cdecl__fastcall, or __stdcall. All __vectorcall functions must have prototypes.

Compile As

Select compile language option for .c and .cpp files. Sets /TC/TP.

Choices

  • Default - Default.
  • Compile as C Code - Compile as C Code.
  • Compile as C++ Code - Compile as C++ Code.

Disable Specific Warnings

Disable the specified warning numbers. Put the warning numbers in a semi-colon delimited list. Sets /wd<number>.

Forced Include File

one or more forced include files. Sets /FI<name>.

Forced #using File

Specifies one or more forced #using files. Sets /FU<name>.

Show Includes

Generates a list of include files with compiler output. Sets /showIncludes.

Use Full Paths

Use full paths in diagnostic messages. Sets /FC.

Omit Default Library Name

Doesn't include default library names in .obj files. Sets /Zl.

Internal Compiler Error Reporting

 Note

This option is deprecated. Starting in Windows Vista, error reporting is controlled by Windows Error Reporting (WER) settings.

Treat Specific Warnings As Errors

Treats the specific compiler warning as an error where n is a compiler warning.

Additional Options

Additional Options.


Recommended content

  • /I (Additional include directories)

    Learn more about: /I (Additional include directories)

  • Windows C++ project property page reference - Visual Studio

    Learn more about: Windows C++ project property page reference

  • Linker Property Pages

    Learn more about: Linker Property Pages

  • Set C++ compiler and build properties in Visual Studio

    Use the Visual Studio IDE to change C++ compiler and linker options and other build settings.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Linker Property Pages

The following properties are found under Project > Properties > Configuration Properties > Linker. For more information about the linker, see CL Invokes the Linker and Linker Options.

General Property Page

Output File

The /OUT option overrides the default name and location of the program that the linker creates.

Show Progress

Prints Linker Progress Messages

Choices

  • Not Set - No verbosity.
  • Display all progress messages - Displays all progress messages.
  • For Libraries Searched - Displays progress messages indicating just the libraries searched.
  • About COMDAT folding during optimized linking - Displays information about COMDAT folding during optimized linking.
  • About data removed during optimized linking - Displays information about functions and data removed during optimized linking.
  • About Modules incompatible with SEH - Displays information about modules incompatible with Safe Exception Handling.
  • About linker activity related to managed code - Display information about linker activity related to managed code.

Version

The /VERSION option tells the linker to put a version number in the header of the .exe or .dll file. Use DUMPBIN /HEADERS to see the image version field of the OPTIONAL HEADER VALUES to see the effect of /VERSION.

Enable Incremental Linking

Enables incremental linking. (/INCREMENTAL, /INCREMENTAL:NO)

Suppress Startup Banner

The /NOLOGO option prevents display of the copyright message and version number.

Ignore Import Library

This property tells the linker not to link any .lib output generated from this build into any dependent project. It allows the project system to handle .dll files that don't produce a .lib file when built. If a project depends on another project that produces a DLL, the project system automatically links the .lib file produced by that child project. This property may be unnecessary in projects that produce COM DLLs or resource-only DLLs, because these DLLs don't have any meaningful exports. If a DLL has no exports, the linker doesn't generate a .lib file. If no export .lib file is present, and the project system tells the linker to link with the missing DLL, the link fails. Use the Ignore Import Library property to resolve this problem. When set to Yes, the project system ignores the presence or absence of the .lib file, and causes any project that depends on this project to not link with the nonexistent .lib file.

To programmatically access this property, see IgnoreImportLibrary.

Register Output

Runs regsvr32.exe /s $(TargetPath) on the build output, which is valid only on .dll projects. For .exe projects, this property is ignored. To register an .exe output, set a postbuild event on the configuration to do the custom registration that is always required for registered .exe files.

To programmatically access this property, see RegisterOutput.

Per-user Redirection

Registration in Visual Studio has traditionally been done in HKEY_CLASSES_ROOT (HKCR). With Windows Vista and later operating systems, to access HKCR you must run Visual Studio in elevated mode. Developers don't always want to run in elevated mode but still must work with registration. Per-user redirection allows you to register without having to run in elevated mode.

Per-user redirection forces any writes to HKCR to be redirected to HKEY_CURRENT_USER (HKCU). If per-user redirection is turned off, it can cause Project Build Error PRJ0050 when the program tries to write to HKCR.

Additional Library Directories

Allows the user to override the environmental library path. (/LIBPATH:folder)

Specifies whether to link the .lib files that are produced by dependent projects. Typically, you want to link in the .lib files, but it may not be the case for certain DLLs.

You can also specify a .obj file by providing the file name and relative path, for example "..\..\MyLibProject\MyObjFile.obj". If the source code for the .obj file #includes a precompiled header, for example pch.h, then the pch.obj file is located in the same folder as MyObjFile.obj. You must also add pch.obj as an additional dependency.

Use Library Dependency Inputs

Specifies whether to use the inputs to the librarian tool, rather than the library file itself, when linking in library outputs of project dependencies. In a large project, when a dependent project produces a .lib file, incremental linking is disabled. If there are many dependent projects that produce .lib files, building the application can take a long time. When this property is set to Yes, the project system links in the .obj files for .libs produced by dependent projects, enabling incremental linking.

For information about how to access the General linker property page, see Set C++ compiler and build properties in Visual Studio.

Specifies whether the linker should display a progress indicator showing what percentage of the link is complete. The default is to not display this status information. (/LTCG:STATUS|LTCG:NOSTATUS)

Prevent DLL Binding

/ALLOWBIND:NO sets a bit in a DLL's header that indicates to Bind.exe that the image isn't allowed to be bound. You may not want a DLL to be bound if it has been digitally signed (binding invalidates the signature).

Treat Linker Warning As Errors

/WX causes no output file to be generated if the linker generates a warning.

Force File Output

The /FORCE option tells the linker to create an .exe file or DLL even if a symbol is referenced but not defined, or is multiply defined. It may create invalid .exe file.

Choices

  • Enabled - /FORCE with no arguments implies both multiple and unresolved.
  • Multiply Defined Symbol Only - Use /FORCE:MULTIPLE to create an output file, even if LINK finds more than one definition for a symbol.
  • Undefined Symbol Only - Use /FORCE:UNRESOLVED to create an output file whether or not LINK finds an undefined symbol. /FORCE:UNRESOLVED is ignored if the entry point symbol is unresolved.

Create Hot Patchable Image

Prepares an image for hotpatching.

Choices

  • Enabled - Prepares an image for hotpatching.
  • X86 Image Only - Prepares an X86 image for hotpatching.
  • X64 Image Only - Prepares an X64 image for hotpatching.
  • Itanium Image Only - Prepares an Itanium image for hotpatching.

Specify Section Attributes

The /SECTION option changes the attributes of a section, overriding the attributes set when the .obj file for the section was compiled.

Input Property Page

Additional Dependencies

Specifies additional items to add to the link command line, for example kernel32.lib.

Ignore All Default Libraries

The /NODEFAULTLIB option tells the linker to remove one or more default libraries from the list of libraries it searches when resolving external references.

Ignore Specific Default Libraries

Specifies one or more names of default libraries to ignore. Separate multiple libraries with semi-colons. (/NODEFAULTLIB:[name, name, ...])

Module Definition File

The /DEF option passes a module-definition file (.def) to the linker. Only one .def file can be specified to LINK.

Add Module to Assembly

The /ASSEMBLYMODULE option allows you to add a module reference to an assembly. Type information in the module will not be available to the assembly program that added the module reference. However, type information in the module will be available to any program that references the assembly.

Embed Managed Resource File

/ASSEMBLYRESOURCE embeds a resource file in the output file.

Force Symbol References

The /INCLUDE option tells the linker to add a specified symbol to the symbol table.

Delay Loaded DLLs

The /DELAYLOAD option causes delayed loading of DLLs. The dll name specifies a DLL to delay load.

The /ASSEMBLYLINKRESOURCE option creates a link to a .NET Framework resource in the output file; the resource file is not placed in the output file.

Manifest File Property Page

Generate Manifest

/MANIFEST specifies that the linker should create a side-by-side manifest file.

Manifest File

/MANIFESTFILE lets you change the default name of the manifest file. The default name of the manifest file is the file name with .manifest appended.

Additional Manifest Dependencies

/MANIFESTDEPENDENCY lets you specify attributes that will be placed in the dependency section of the manifest file.

Allow Isolation

Specifies behavior for manifest lookup. (/ALLOWISOLATION:NO)

Enable User Account Control (UAC)

Specifies whether or not User Account Control is enabled. (/MANIFESTUAC, /MANIFESTUAC:NO)

UAC Execution Level

Specifies the requested execution level for the application when running with User Account Control. (/MANIFESTUAC:level=[value])

Choices

  • asInvoker - UAC Execution Level: as invoker.
  • highestAvailable - UAC Execution Level: highest available.
  • requireAdministrator - UAC Execution Level: require administrator.

UAC Bypass UI Protection

Specifies whether or not to bypass user interface protection levels for other windows on the desktop. Set this property to 'Yes' only for accessibility applications. (/MANIFESTUAC:uiAccess=[true | false])

Debugging Property Page

Generate Debug Info

This option enables creation of debugging information for the .exe file or the DLL.

Choices

  • No - Produces no debugging information.
  • Generate Debug Information - Create a complete Program Database (PDB) ideal for distribution to Microsoft Symbol Server.
  • Generate Debug Information optimized for faster links - Produces a program database (PDB) ideal for edit-link-debug cycle.
  • Generate Debug Information optimized for sharing and publishing - Produces a program database (PDB) ideal for edit-link-debug cycle.

Generate Program Database File

By default, when /DEBUG is specified, the linker creates a program database (PDB) which holds debugging information. The default file name for the PDB has the base name of the program and the extension .pdb.

Strip Private Symbols

The /PDBSTRIPPED option creates a second program database (PDB) file when you build your program image with any of the compiler or linker options that generate a PDB file (/DEBUG, /Z7, /Zd, or /Zi).

Generate Map File

The /MAP option tells the linker to create a mapfile.

Map File Name

A user-specified name for the mapfile. It replaces the default name.

Map Exports

The /MAPINFO option tells the linker to include the specified information in a mapfile, which is created if you specify the /MAP option. EXPORTS tells the linker to include exported functions.

Debuggable Assembly

/ASSEMBLYDEBUG emits the DebuggableAttribute attribute with debug information tracking and disables JIT optimizations.

System Property Page

SubSystem

The /SUBSYSTEM option tells the operating system how to run the .exe file. The choice of subsystem affects the entry point symbol (or entry point function) that the linker will choose.

Choices

  • Not Set - No subsystem set.
  • Console - Win32 character-mode application. Console applications are given a console by the operating system. If main or wmain is defined, CONSOLE is the default.
  • Windows - Application does not require a console, probably because it creates its own windows for interaction with the user. If WinMain or wWinMain is defined, WINDOWS is the default.
  • Native - Device drivers for Windows NT. If /DRIVER:WDM is specified, NATIVE is the default.
  • EFI Application - EFI Application.
  • EFI Boot Service Driver - EFI Boot Service Driver.
  • EFI ROM - EFI ROM.
  • EFI Runtime - EFI Runtime.
  • POSIX - Application that runs with the POSIX subsystem in Windows NT.

Minimum Required Version

Specify the minimum required version of the subsystem. The arguments are decimal numbers in the range 0 through 65,535.

Heap Reserve Size

Specifies total heap allocation size in virtual memory. Default is 1 MB. (/HEAP:reserve)

Heap Commit Size

Specifies total heap allocation size in physical memory. Default is 4 KB. (/HEAP:reserve,commit)

Stack Reserve Size

Specifies the total stack allocation size in virtual memory. Default is 1 MB. (/STACK:reserve)

Stack Commit Size

Specifies the total stack allocation size in physical memory. Default is 4 KB. (/STACK:reserve,commit)

Enable Large Addresses

The /LARGEADDRESSAWARE option tells the linker that the application can handle addresses larger than 2 gigabytes. By default, /LARGEADDRESSAWARE:NO is enabled if /LARGEADDRESSAWARE is not otherwise specified on the linker line.

Terminal Server

The /TSAWARE option sets a flag in the IMAGE_OPTIONAL_HEADER DllCharacteristics field in the program image's optional header. When this flag is set, Terminal Server will not make certain changes to the application.

Swap Run From CD

The /SWAPRUN option tells the operating system to first copy the linker output to a swap file, and then run the image from there. This option is a Windows NT 4.0 (and later) feature. When CD is specified, the operating system will copy the image on a removable disk to a page file and then load it.

Swap Run From Network

The /SWAPRUN option tells the operating system to first copy the linker output to a swap file, and then run the image from there. This option is a Windows NT 4.0 (and later) feature. If NET is specified, the operating system will first copy the binary image from the network to a swap file and load it from there. This option is useful for running applications over the network.

Driver

Use the /DRIVER linker option to build a Windows NT kernel mode driver.

Choices

  • Not Set - Default driver setting.
  • Driver - Driver
  • UP Only - /DRIVER:UPONLY causes the linker to add the IMAGE_FILE_UP_SYSTEM_ONLY bit to the characteristics in the output header to specify that it is a uniprocessor (UP) driver. The operating system will refuse to load a UP driver on a multiprocessor (MP) system.
  • WDM - /DRIVER:WDM causes the linker to set the IMAGE_DLLCHARACTERISTICS_WDM_DRIVER bit in the optional header's DllCharacteristics field.

Optimization Property Page

References

/OPT:REF eliminates functions and/or data that's never referenced while /OPT:NOREF keeps functions and/or data that's never referenced.

Enable COMDAT Folding

Use /OPT:ICF[=iterations] to perform identical COMDAT folding.

Function Order

The /ORDERoption tells LINK to optimize your program by placing certain COMDATs into the image in a predetermined order. LINK places the functions in the specified order within each section in the image.

Profile Guided Database

Specify .pgd file for profile guided optimizations. (/PGD)

Specifies link-time code generation. (/LTCG)

Choices

  • Default - Default LTCG setting.
  • Use Fast Link Time Code Generation - Use Link Time Code Generation with /FASTGENPROFILE.
  • Use Link Time Code Generation - Use Link Time Code Generation.
  • Profile Guided Optimization - Instrument - Use profile guided optimization with :PGINSTRUMENT.
  • Profile Guided Optimization - Optimization - Specifies that the linker should use the profile data created after running the instrumented binary to create an optimized image.
  • Profile Guided Optimization - Update - Allows and tracks list of input files to be added or modified from what was specified in the :PGINSTRUMENT phase.

Embedded IDL Property Page

MIDL Commands

Specify MIDL command line Options. (/MIDL:@responsefile)

Ignore Embedded IDL

The /IGNOREIDL option specifies that any IDL attributes in source code should not be processed into an .idl file.

Merged IDL Base File Name

The /IDLOUT option specifies the name and extension of the .idl file.

Type Library

The /TLBOUT option specifies the name and extension of the .tlb file.

TypeLib Resource ID

Allows you to specify the resource ID of the linker-generated type library. (/TLBID:id)

Windows Metadata Property Page

Generate Windows Metadata

Enables or disable generation of Windows Metadata.

Choices

  • Yes - Enable generation of Windows Metadata files.
  • No - Disable the generation of Windows Metadata files.

Windows Metadata File

The /WINMDFILE option switch.

Windows Metadata Key File

Specify key or key pair to sign an Windows Metadata. (/WINMDKEYFILE:filename)

Windows Metadata Key Container

Specify a key container to sign an Windows Metadata. (/WINMDKEYCONTAINER:name)

Windows Metadata Delay Sign

Partially sign an Windows Metadata. Use /WINMDDELAYSIGN if you only want to place the public key in the Windows Metadata. The default is /WINMDDELAYSIGN:NO.

Advanced Property Page

Entry Point

The /ENTRY option specifies an entry point function as the starting address for an .exe file or DLL.

No Entry Point

The /NOENTRYoption is required for creating a resource-only DLL.Use this option to prevent LINK from linking a reference to _main into the DLL.

Set Checksum

The /RELEASE option sets the Checksum in the header of an .exe file.

Base Address

Sets a base address for the program. (/BASE:{address[,size] | @filename,key})

Randomized Base Address

Randomized Base Address. (/DYNAMICBASE[:NO])

Fixed Base Address

Creates a program that can be loaded only at its preferred base address. (/FIXED[:NO])

Data Execution Prevention (DEP)

Marks an executable as having been tested to be compatible with Windows Data Execution Prevention feature. (/NXCOMPAT[:NO])

Turn Off Assembly Generation

The /NOASSEMBLY option tells the linker to create an image for the current output file without a .NET Framework assembly.

Unload delay loaded DLL

The UNLOAD qualifier tells the delay-load helper function to support explicit unloading of the DLL. (/DELAY:UNLOAD)

Nobind delay loaded DLL

The NOBIND qualifier tells the linker not to include a bindable IAT in the final image. The default is to create the bindable IAT for delay-loaded DLLs. (/DELAY:NOBIND)

Import Library

Overrides the default import library name. (/IMPLIB:filename)

Merge Sections

The /MERGE option combines the first section (from) with the second section (to), naming the resulting section to. For example, /merge:.rdata=.text.

Target Machine

The /MACHINE option specifies the target platform for the program.

Choices

  • Not Set
  • MachineARM
  • MachineARM64
  • MachineEBC
  • MachineIA64
  • MachineMIPS
  • MachineMIPS16
  • MachineMIPSFPU
  • MachineMIPSFPU16
  • MachineSH4
  • MachineTHUMB
  • MachineX64
  • MachineX86

Profile

Produces an output file that can be used with the Performance Tools profiler. Requires GenerateDebugInformation (//DEBUG) to be set. (/PROFILE)

CLR Thread Attribute

Explicitly specify the threading attribute for the entry point of your CLR program.

Choices

  • MTA threading attribute - Applies the MTAThreadAttribute attribute to the entry point of your program.
  • STA threading attribute - Applies the STAThreadAttribute attribute to the entry point of your program.
  • Default threading attribute - Same as not specifying /CLRTHREADATTRIBUTE. Lets the Common Language Runtime (CLR) set the default threading attribute.

CLR Image Type

Sets the type (IJW, pure, or safe) of a CLR image.

Choices

  • Force IJW image
  • Force Pure IL Image
  • Force Safe IL Image
  • Default image type

Key File

Specify key or key pair to sign an assembly. (/KEYFILE:filename)

Key Container

Specify a key container to sign an assembly. (/KEYCONTAINER:name)

Delay Sign

Partially sign an assembly. Use /DELAYSIGN if you only want to place the public key in the assembly. The default is /DELAYSIGN:NO.

CLR Unmanaged Code Check

/CLRUNMANAGEDCODECHECK specifies whether the linker will apply SuppressUnmanagedCodeSecurityAttribute to linker-generated PInvoke calls from managed code into native DLLs.

Error Reporting

Allows you to provide internal compiler error (ICE) information directly to the Visual C++ team.

Choices

  • PromptImmediately - Prompt immediately.
  • Queue For Next Login - Queue for next login.
  • Send Error Report - Send error report.
  • No Error Report - No error report.

SectionAlignment

The /ALIGN option specifies the alignment of each section within the linear address space of the program. The number argument is in bytes and must be a power of two.

Preserve Last Error Code for PInvoke Calls

/CLRSUPPORTLASTERROR, which is on by default, preserves the last error code of functions called through the P/Invoke mechanism, which allows you to call native functions in DLLS, from code compiled with /clr.

Choices

  • Enabled - Enable CLRSupportLastError.
  • Disabled - Disable CLRSupportLastError.
  • System Dlls Only - Enable CLRSupportLastError for system dlls only.

Image Has Safe Exception Handlers

When /SAFESEH is specified, the linker will only produce an image if it can also produce a table of the image's safe exception handlers. This table specifies for the operating system which exception handlers are valid for the image.


Recommended content

  • C/C++ Project Properties (Visual Studio)

    Reference guide to the Visual Studio Microsoft C/C++ project Property Pages properties.

  • .Lib Files as Linker Input

    Learn more about: .Lib Files as Linker Input

  • Configure C++ projects for 64-bit, x64 targets

    Learn more about: Configure C++ projects for 64-bit, x64 targets

  • Consuming libraries and components in C++ projects

    Learn more about: Consuming libraries and components

 

 

 

 

 

 

 

 

 

Manifest Tool Property Pages

Use these pages to specify general options for Mt.exe. These pages are found under Project > Properties > Configuration Properties > Manifest Tool.

General Property Page

Suppress Startup Banner

Yes (/nologo) specifies that standard Microsoft copyright data will be concealed when the manifest tool is started. Use this option to suppress unwanted output in log files when you run mt.exe, either as part of a build process or from a build environment.

Verbose Output

Yes (/verbose) specifies that more build information will be displayed during manifest generation.

Assembly Identity

Uses the /identity option to specify an identity string, which holds the attributes for the <assemblyIdentity> element. An identity string begins with the value for the name attribute, and is followed by attribute = value pairs. The attributes in an identity string are delimited by a comma.

Here's an example identity string:

Microsoft.Windows.Common-Controls, processorArchitecture=x86, version=6.0.0.0, type=win32, publicKeyToken=6595b64144ccf1df

Input and Output Property Page

Additional Manifest Files

Uses the /manifest option to specify the full paths of more manifest files that the manifest tool will process or merge. Full paths are delimited by a semicolon. (/manifest [manifest1] [manifest2] ...)

Input Resource Manifests

Uses the /inputresource option to specify the full path of a resource of type RT_MANIFEST, to input into the manifest tool. The path can be followed by the specified resource ID. For example:

dll_with_manifest.dll;#1

Embed Manifest

  • Yes specifies that the project system will embed the application manifest file into the assembly.

  • No specifies that the project system will create the application manifest file as a stand-alone file.

Output Manifest File

Specifies the name of the output manifest file. This property is optional when only one manifest file is operated upon by the manifest tool. (/out:[file];#[resource ID])

Manifest Resource File

Specifies the output resources file used to embed the manifest into the project output.

Generate Catalog Files

Uses the /makecdfs option to specify that the manifest tool will generate catalog definition files (.cdf files), which are used to make catalogs. (/makecdfs)

Generate Manifest From ManagedAssembly

Generates a manifest from a managed assembly. (/managedassemblyname:[file])

Suppress Dependency Element

Used with /managedassemblyname. Suppresses the generation of dependency elements in the final manifest. (/nodependency)

Generate Category Tags

Used with /managedassemblyname/category causes the category tags to be generated. (/category)

DPI Awareness

Specifies whether the application is DPI-aware. By default, the setting is Yes for MFC projects and No otherwise because only MFC projects have built in DPI awareness. You can override the setting to Yes if you add code to handle different DPI settings. Your application might appear fuzzy or small if it isn't DPI-aware, but you set a DPI-aware option.

Choices

  • None
  • High DPI Aware
  • Per Monitor High DPI Aware

Isolated COM Property Page

For more information about isolated COM, see Isolated applications and How to: Build isolated applications to consume COM components.

Type Library File

Specifies the type library to use for regfree COM manifest support. (/tlb:[file])

Registrar Script File

Specifies the registrar script file to use for regfree COM manifest support. (/rgs:[file])

Component File Name

Specifies the file name of the component that is built from the .tlb or .rgs specified. (/dll:[file])

Replacements File

Specifies the file that contains values for replaceable strings in the RGS file. (/replacements:[file])

Advanced Property Page

Update File Hashes

Computes the hash of files specified in the file elements, and then updates the hash attribute with this value. (/hashupdate:[path])

Update File Hashes Search Path

Specifies the search path to use when updating the file hashes.

Additional Options

Allows you to specify more options.

See also

C++ project property page reference


Recommended content

  • Understanding Manifest Generation for C/C++ Programs

    Learn more about: Understanding Manifest Generation for C/C++ Programs

  • Update WINVER and _WIN32_WINNT

    When and how to update WINVER and _WIN32_WINNT macros in upgraded Visual Studio C++ projects.

  • Resource Compiler - Win32 apps

    The Microsoft Windows Resource Compiler (RC) is a tool used in building Windows-based applications.

  • Using RC (The RC Command Line) - Win32 apps

    To start RC, use the following command.

 
 

 

 

XML Document Generator Tool Property Pages

The XML Document Generator Tool property page exposes the functionality of xdcmake.exe, or XDCMake. XDCMake merges .xdc files into an .xml file when your source code contains documentation comments and /doc (Process Documentation Comments) (C/C++) is specified. For more information on adding documentation comments to source code, see Recommended tags for documentation comments.

 Note

XDCMake options in the development environment (property pages) differ from the options when xdcmake.exe is used at the command line. For information on using xdcmake.exe at the command line, see XDCMake reference.

UIElement List

  • Suppress Startup Banner

    Suppress copyright message.

  • Additional Document Files

    Additional directories in which you want the project system to look for .xdc files. XDCMake always looks for .xdc files generated by the project. Multiple directories can be specified.

  • Output Document File

    The name and directory location of the .xml output file. For more information on using macros to specify directory locations, see Common macros for build commands and properties.

  • Document Library Dependencies

    If your project has a dependency on a .lib project in the solution, you can process .xdc files from the .lib project into the .xml files for the current project.

See also

C++ project property page reference


Recommended content

  • General Property Page (Project)

    Learn more about: General Property Page (Project)

  • VC++ Directories Property Page

    Learn more about: VC++ Directories Property Page (Windows)

  • Create custom views of C++ objects - Visual Studio (Windows)

    Use the Natvis framework to customize the way that Visual Studio displays native types in the debugger

  • Upgrade C++ projects from earlier versions of Visual Studio

    How to upgrade Microsoft C++ projects from older versions of Visual Studio.

 

 
 

posted on 2022-03-22 16:26  wu.g.q  阅读(375)  评论(0编辑  收藏  举报

导航