Skip to content

Latest commit

 

History

History
84 lines (67 loc) · 6.45 KB

c-cpp-linux.md

File metadata and controls

84 lines (67 loc) · 6.45 KB
titlems.datedescriptionms.assetidf1_keywords
C/C++ Properties (Linux C++)
10/14/2020
Describes the Linux compilation options on the Visual Studio C/C++ properties page
4bb8894b-c874-4a68-935e-b127d54e484f

C/C++ Properties (Linux C++)

::: moniker range="msvc-140"

Linux support is available in Visual Studio 2017 and later.

::: moniker-end

::: moniker range=">=msvc-150"

General

PropertyDescriptionChoices
Additional Include DirectoriesSpecifies one or more directories to add to the include path. Use semi-colons to separate multiple directories. (-I[path]).
Debug Information FormatSpecifies the type of debugging information generated by the compiler.None - Produces no debugging information, so compilation may be faster.
Minimal Debug Information - Generate minimal debug information.
Full Debug Information (DWARF2) - Generate DWARF2 debug information.
Object File NameSpecifies a name to override the default object file name. It can be a file or directory name. (-o [name]).
Warning LevelSelects how strict you want the compiler to be about code errors. Add other flags directly to Additional Options. (/w, /Weverything).Turn Off All Warnings - Disables all compiler warnings.
EnableAllWarnings - Enables all warnings, including ones disabled by default.
Treat Warnings As ErrorsTreats all compiler warnings as errors. For a new project, it may be best to use /Werror in all compilations. Resolve all warnings to ensure the fewest possible hard-to-find code defects.
C Additional WarningsDefines a set of additional warning messages.
C++ Additional WarningsDefines a set of additional warning messages.
Enable Verbose modeWhen Verbose mode is enabled, prints out more information to diagnose the build.
C CompilerSpecifies the program to invoke during compilation of C source files, or the path to the C compiler on the remote system.
C++ CompilerSpecifies the program to invoke during compilation of C++ source files, or the path to the C++ compiler on the remote system.
Compile TimeoutRemote compilation timeout, in milliseconds.
Copy Object FilesSpecifies whether to copy the compiled object files from the remote system to the local machine.
Max Parallel Compilation JobsThe number of processes to create in parallel during compilation. The default is 1. If you're using Windows Subsystem for Linux (WSL) version 1, the limit is 64.
Validate ArchitectureSpecify whether to check if the platform the project targets matches the remote system.
Enable Address SanitizerCompile the program with Address Sanitizer, which is a fast memory error detector that can find runtime memory issues such as use-after-free, and perform out of bounds checks.

Optimization

PropertyDescriptionChoices
OptimizationSpecifies the optimization level for the application.Custom - Custom optimization.
Disabled - Disable optimization.
Minimize Size - Optimize for size.
Maximize Speed - Optimize for speed.
Full Optimization - Expensive optimizations.
Strict AliasingAssumes the strictest aliasing rules. An object of one type is never assumed to have the same address as an object of a different type.
Unroll LoopsUnrolls loops to make the application faster by reducing the number of branches executed, at the cost of larger code size.
Link Time OptimizationEnables inter-procedural optimizations by allowing the optimizer to look across object files in your application.
Omit Frame PointerSuppresses creation of frame pointers on the call stack.
No Common BlocksAllocates even uninitialized global variables in the data section of the object file, rather than generate them as common blocks.

Preprocessor

PropertyDescription
Preprocessor DefinitionsDefines preprocessing symbols for your source file. (-D)
Undefine Preprocessor DefinitionsSpecifies one or more preprocessor undefines. (-U [macro])
Undefine All Preprocessor DefinitionsUndefines all previously defined preprocessor values. (-undef)
Show IncludesGenerates a list of include files with compiler output. (-H)

Code Generation

PropertyDescriptionChoices
Position Independent CodeGenerates position-independent code (PIC) for use in a shared library.
Statics are thread safeEmits extra code to use routines specified in the C++ ABI for thread-safe initialization of local statics.No - Disable thread-safe statics.
Yes - Enable thread-safe statics.
Floating Point OptimizationEnables floating-point optimizations by relaxing IEEE-754 conformance.
Inline Methods HiddenWhen enabled, out-of-line copies of inline methods are declared private extern.
Symbols Hidden By DefaultAll symbols are declared private extern unless explicitly marked for export by using the __attribute macro.
Enable C++ ExceptionsSpecifies the exception-handling model used by the compiler.No - Disable exception handling.
Yes - Enable exception handling.

Language

PropertyDescriptionChoices
Enable Run-Time Type InformationAdds code for checking C++ object types at run time (runtime type information). (frtti, fno-rtti)
C Language StandardDetermines the C language standard.Default
C89 - C89 Language Standard.
C99 - C99 Language Standard.
C11 - C11 Language Standard.
C99 (GNU Dialect) - C99 (GNU Dialect) Language Standard.
C11 (GNU Dialect) - C11 (GNU Dialect) Language Standard.
C++ Language StandardDetermines the C++ language standard.Default
C++03 - C++03 Language Standard.
C++11 - C++11 Language Standard.
C++14 - C++14 Language Standard.
C++03 (GNU Dialect) - C++03 (GNU Dialect) Language Standard.
C++11 (GNU Dialect) - C++11 (GNU Dialect) Language Standard.
C++14 (GNU Dialect) - C++14 (GNU Dialect) Language Standard.

Advanced

PropertyDescriptionChoices
Compile AsSelects compilation language option for .c and .cpp files. (-x c, -x c++)Default - Detect based on the .c or .cpp extension.
Compile as C Code - Compile as C code.
Compile as C++ Code - Compile as C++ code.
Forced Include FilesSpecifies one or more forced include files (-include [name])

::: moniker-end

close