Training
Learning path
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The following property pages are found under Project > Properties > Configuration Properties > C/C++:
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.
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.
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.
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.
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.
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 (/exportHeader), are always scanned.
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.
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.
Adds supporting code for enabling Just My Code debugging in this compilation unit. Sets /JMC
.
Use the .NET runtime service. This switch is incompatible with some other switches; see the documentation on the /clr
family of switches for details.
Consume the Windows Run Time languages extensions. Sets /ZW
.
Suppresses the display of the sign-on banner when the compiler starts up and display of informational messages during compiling.
Select how strict you want the compiler to be about code errors. Sets /W0
- /W4
.
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.
Hide warnings introduced after a specific version of the compiler. Sets /Wv:xx[.yy[.zzzzz]]
.
Enables rich diagnostics, with column information and source context in diagnostic messages.
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-
.
Enable multi-processor compilation. Sets the /MP
compiler option.
Compiles and links the program with AddressSanitizer instrumentation. This property currently supports x86 and x64 target builds. Sets the /fsanitize
compiler option.
Select option for code optimization; choose Custom to use specific optimization options. Sets /Od
, /O1
, /O2
.
/Os /Oy /Ob2 /Gs /GF /Gy
/Oi /Ot /Oy /Ob2 /Gs /GF /Gy
/Oi /Ot /Oy /Ob2
Select the level of inline function expansion for the build. Sets /Ob
.
inline
, __forceinline
, or __inline
. Or, in a C++ member function, defined within a class declaration.inline
or __inline
and any other function that the compiler chooses. (Expansion occurs at the compiler's discretion, often referred to as autoinlining.)Enables intrinsic functions. Using intrinsic functions generates faster, but possibly larger, code. Sets /Oi
.
Whether to favor code size or code speed; 'Global Optimization' must be turned on. Sets /Ot
, /Os
.
Suppresses creation of frame pointers on the call stack.
Enables memory space optimization when using fibers and thread local storage access. Sets /GT
.
Enables cross-module optimizations by delaying code generation to link time. Requires the linker option Link Time Code Generation. Sets /GL
.
Defines preprocessing symbols for your source file.
Specifies one or more preprocessor undefines. Sets /U
.
Undefine all previously defined preprocessor values. Sets /u
.
Prevents the compiler from searching for include files in directories specified in the INCLUDE environment variables.
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 without #line directives.
Suppresses comment strip from source code; requires setting at least one of the Preprocessing options. Sets /C
.
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.
Enables minimal rebuild, which determines whether to recompile C++ source files that include changed C++ class definitions, stored in header .h
files.
Specifies the model of exception handling to be used by the compiler.
/EHa
./EHsc
./EHs
.Enable checking for conversion to smaller types, incompatible with any optimization type other than debug. Sets /RTCc
.
Enable basic runtime error checks, incompatible with any optimization type other than debug. Sets /RTCs
, /RTCu
, /RTC1
.
/RTCsu
.Specify runtime library for linking. Sets /MT
, /MTd
, /MD
, /MDd
.
_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._MT
and _DLL
and causes the compiler to place the library name MSVCRT.lib into the .obj
file._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.Specifies 1, 2, 4, or 8-byte boundaries for struct member alignment. Sets /Zp
.
/Zp
.The Security Check helps detect stack-buffer over-runs, a common attempted attack upon a program's security.
/GS-
./GS
.Guard security check helps detect attempts to dispatch to illegal block of code.
/guard:cf
.Allows the compiler to package individual functions in the form of packaged functions (COMDATs). Required for edit and continue to work. Sets /Gy
.
Allows the compiler to generate parallel code for loops identified using #pragma loop(hint_parallel[(n)])
when optimization is enabled.
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 uses 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)
, /arch (ARM64)
, and /arch (ARM)
.
/arch:SSE
/arch:SSE2
/arch:AVX
/arch:AVX2
/arch:IA32
Sets the floating point model. Sets /fp:precise
, /fp:strict
, /fp:fast
.
/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.Reliable floating-point exception model. Exceptions will be raised immediately after they're triggered. Sets /fp:except
.
When hotpatching is on, the compiler ensures that first instruction of each function is two bytes, as required for hot patching. Sets /hotpatch
.
Spectre mitigations for CVE 2017-5753. Sets /Qspectre
.
Suppresses or enables language extensions. Sets /Za
.
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.
Implements standard C++ behavior for the for
statement loops with Microsoft extensions. Sets /Za
, /Ze
(Disable language extensions. /Zc:forScope
is on by default.
When specified, the compiler no longer generates symbol information for unreferenced code and data.
Used to identify an rvalue reference type as the result of a cast operation according to the C++11 standard.
Adds code for checking C++ object types at run time (runtime type information, or RTTI). Sets /GR
, /GR-
.
Enables OpenMP 2.0 language extensions. Sets /openmp
.
Determines the C++ language standard that 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).
Determines the C language standard that the compiler enables. The default value doesn't set a standard option, so the compiler uses its default legacy MSVC setting. If you select a specific value, the corresponding /std
compiler option is set.md).
Enables or suppresses conformance mode. Sets /permissive-
.
Experimental support for the C++ Modules TS and Standard Library modules.
Starting in Visual Studio 17.6, when this property is enabled and C++ Language Standard is set to /std:c++latest
, Visual C++ projects automatically find and build ISO C++23 Standard Library modules. This enables you to import std
or import std.compat
in your C++ code.
Enables creation or use of a precompiled header during the build. Sets /Yc
, /Yu
.
.pch
) file that represents the state of compilation at a certain point..pch
) file in the current compilation.Specifies header file name to use when creating or using a precompiled header file. Sets /Yc
, /Yu
.
Specifies the path or name of the generated precompiled header file. Sets /Fp
.
Create listing file with expanded attributes injected into source file. Sets /Fx
.
Specifies the contents of assembly language output file. Sets /FA
, /FAc
, /FAs
, /FAcs
.
.asm
.cod
.asm
.cod
Causes the output file to be created in UTF-8 format.
Specifies relative path or name for ASM listing file; can be file or directory name. Sets /Fa
.
Specifies a name to override the default object file name; can be file or directory name. Sets /Fo
.
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
.
Specifies that the compiler should generate XML documentation comment files (.XDC). Sets /doc
.
Specifies the name of the generated XML documentation files; can be file or directory name. Sets /doc:
<name>.
Specifies level of browse information in .bsc
file. Sets /FR
.
Specifies optional name for browser information file. Sets /FR
<name>.
Specifies whether to treat files included with angle brackets as external. Set this property to Yes to set the /external:anglebrackets
compiler option.
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.
Specifies whether to evaluate the warning level across a template instantiation chain. Set this property to Yes to set the /external:templates-
compiler option.
Disables code analysis for external headers. Sets the /analyze:external-
compiler option.
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.
Select the default calling convention for your application (can be overridden by function). Sets /Gd
, /Gr
, /Gz
, /Gv
.
__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.Select compile language option for source files. Sets /TC
, /TP
, /interface, /internalPartition
, or /exportHeader
options.
/TC
) - Compile specified source files as C code. By default, files with a .c
extension are compiled as C./TP
) - Compile specified source files as C++ code. By default, all source files that don't have a .c
, .ixx
, .cppm
, .h
, or no extension are compiled as C++./interface
) - Compile specified source files as C++ module code. By default, files with a .ixx
or .cppm
extension are compiled as C++ module code./internalPartition
) - Compile specified source files as C++ module internal partition./exportHeader
) - Compile specified source files as C++ header unit. By default, files with a .h
extension or no extension are compiled as header units.Disable the specified warning numbers. Put the warning numbers in a semi-colon delimited list. Sets /wd
<number>.
one or more forced include files. Sets /FI
<name>.
Specifies one or more forced #using files. Sets /FU
<name>.
Generates a list of include files with compiler output. Sets /showIncludes
.
Use full paths in diagnostic messages. Sets /FC
.
Doesn't include default library names in .obj
files. Sets /Zl
.
Note
This option is deprecated. Starting in Windows Vista, error reporting is controlled by Windows Error Reporting (WER) settings.
Treats the specific compiler warning as an error where n is a compiler warning.
Additional Options.
Training
Learning path
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization