description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | |||||
---|---|---|---|---|---|---|---|---|---|---|
Learn more about: /FC (Full path of source code file in diagnostics) | /FC (Full path of source code file in diagnostics) | 04/26/2021 |
|
| 1f11414e-cb42-421b-be68-9d369aab036b |
Causes the compiler to display the full path of source code files passed to the compiler in diagnostics.
/FC
Consider the following code sample, where the source file is located in C:\test\compiler_option_FC.cpp
:
// compiler_option_FC.cppintmain( ) { int i // C2143 }
Without /FC
, the compiler output looks similar to this diagnostic text:
- compiler_option_FC.cpp(5): error C2143: syntax error: missing ';' before '}'
With /FC
, the compiler output looks similar to this diagnostic text:
::: moniker range="<=msvc-150"
- c:\test\compiler_option_fc.cpp(5): error C2143: syntax error: missing ';' before '}'
::: moniker-end ::: moniker range=">=msvc-160"
- C:\test\compiler_option_FC.cpp(5): error C2143: syntax error: missing ';' before '}'
::: moniker-end
/FC
is also needed if you want to see the full path of a file name when using the __FILE__
macro. For more information about __FILE__
, see Predefined macros.
The /FC
option is implied by /ZI
. For more information about /ZI
, see /Z7, /Zi, /ZI
(Debug information format).
In Visual Studio 2017 and earlier versions, /FC
outputs full paths in lower case. Starting in Visual Studio 2019, /FC
uses the same casing as the file system for full paths.
Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
Select the Configuration Properties > C/C++ > Advanced property page.
Modify the Use Full Paths property.
- See xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.UseFullPaths%2A.