在vs中__FILE__宏代表了当前文件,如果有/FC那么__FILE__代表了当前文件的全路径!否则只表示当前文件名
/FC (Full Path of Source Code File in Diagnostics)
![[原]__FILE__宏 [原]__FILE__宏](https://image.shishitao.com:8440/aHR0cDovL2ltYWdlczIwMTUuY25ibG9ncy5jb20vYmxvZy85ODUxMjcvMjAxNzAxLzk4NTEyNy0yMDE3MDEwNjEzNTIzODI2OS0xODczMzA3MTU5LnBuZw%3D%3D.png?w=700&webp=1)
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
Causes the compiler to display the full path of source code files passed to the compiler in diagnostics.
/FC
Consider the following code sample:
// compiler_option_FC.cpp int main( ) { int i // C2143 }
Without /FC, the diagnostic text would look similar to this diagnostic text:
- compiler_option_FC.cpp(5) : error C2143: syntax error : missing ';' before '}'
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 '}'
/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__.
The /FC option is implied by /ZI. For more information about /ZI, see /Z7, /Zi, /ZI (Debug Information Format).
To set this compiler option in the Visual Studio development environment
Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.
Expand the Configuration Properties node.
Expand the C/C++ node.
Select the Advanced property page.
Modify the Use Full Paths property.
To set this linker option programmatically
- See UseFullPaths.