/FC(所诊断源代码文件的完整路径)/FC (Full Path of Source Code File in Diagnostics)

会导致编译器显示传递到编译器诊断中源代码文件的完整路径。Causes the compiler to display the full path of source code files passed to the compiler in diagnostics.

语法Syntax

/FC/FC

备注Remarks

请考虑下面的代码示例:Consider the following code sample:

// compiler_option_FC.cpp
int main( ) {
   int i   // C2143
}

无需 /FC,诊断文本将类似于以下诊断文本:Without /FC, the diagnostic text would look similar to this diagnostic text:

  • compiler_option_FC.cpp(5) : error C2143: syntax error : missing ';' before '}'compiler_option_FC.cpp(5) : error C2143: syntax error : missing ';' before '}'

/FC,诊断文本将类似于以下诊断文本:With /FC, the diagnostic text would look similar to this diagnostic text:

  • c:\test\compiler_option_fc.cpp(5) : error C2143: syntax error : missing ';' before '}'c:\test\compiler_option_fc.cpp(5) : error C2143: syntax error : missing ';' before '}'

/FC如果你想要查看的文件名称的完整路径,使用时也需要__文件__宏。/FC is also needed if you want to see the full path of a file name when using the __FILE__ macro. 请参阅预定义的宏有关详细信息__文件__。See Predefined Macros for more information on __FILE__.

/FC选项也将暗示 /ZIThe /FC option is implied by /ZI. 有关详细信息 /ZI,请参阅/Z7、 /Zi、 /ZI (调试信息格式)For more information about /ZI, see /Z7, /Zi, /ZI (Debug Information Format).

/FC输出采用小写格式的完整路径。/FC outputs full paths in lower case.

在 Visual Studio 开发环境中设置此编译器选项To set this compiler option in the Visual Studio development environment

  1. 打开项目的“属性页” 对话框。Open the project's Property Pages dialog box. 有关详细信息,请参阅设置C++Visual Studio 中的编译器和生成属性For details, see Set C++ compiler and build properties in Visual Studio.

  2. 选择配置属性 > C /C++ > 高级属性页。Select the Configuration Properties > C/C++ > Advanced property page.

  3. 修改使用完全路径属性。Modify the Use Full Paths property.

以编程方式设置此链接器选项To set this linker option programmatically

请参阅See also

MSVC 编译器选项MSVC Compiler Options
MSVC 编译器命令行语法MSVC Compiler Command-Line Syntax