在vs中__FILE__宏代表了当前文件,如果有/FC那么__FILE__代表了当前文件的全路径!否则只表示当前文件名

 

/FC (Full Path of Source Code File in Diagnostics)

Visual Studio 2015
 
Other Versions
 

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.

Syntax

 
 
 
 
/FC  

Remarks

 
 

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

  1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.

  2. Expand the Configuration Properties node.

  3. Expand the C/C++ node.

  4. Select the Advanced property page.

  5. Modify the Use Full Paths property.

To set this linker option programmatically

  1. See UseFullPaths.

See Also

 
 

Compiler Options
Setting Compiler Options

[原]__FILE__宏的更多相关文章

  1. #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #endif

    情况1:#ifdef _DEBUGvirtual void AssertValid() const;                 //assert(断言)valid(有效的,正确的)virtual ...

  2. C语言 第八章 函数、指针与宏

    一.函数 函数是一个包含完成一定功能的执行代码段.我们可以把函数看成一个"黑盒子", 你只要将数据送进去就能得到结果, 而函数内部究竟是如何工作的的, 外部程序是不知道的.外部程序 ...

  3. VC中预处理指令与宏定义详解

    刚接触到MFC编程的人往往会被MFC 向导生成的各种宏定义和预处理指令所吓倒,但是预处理和宏定义又是C语言的一个强大工具.使用它们可以进行简单的源代码控制,版本控制,预警或者完成一些特殊的功能. 一个 ...

  4. C++ 中常见预定义宏的使用

    http://blog.csdn.net/hgl868/article/details/7058906 替代字符串: #define DOWNLOAD_IMAGE_LOG /var/log/png.l ...

  5. C++ 中宏的使用 --来自:http://blog.csdn.net/hgl868/article/details/7058906

    宏在代码中的使用实例: g_RunLog2("Middleware client for Linux, build:%s %s", __DATE__, __TIME__); 下面详 ...

  6. 20个C语言中常用宏定义总结

    01: 防止一个头文件被重复包含 #ifndef COMDEF_H#define COMDEF_H//头文件内容#endif 02: 重新定义一些类型防止由于各种平台和编译器的不同,而产生的类型字节数 ...

  7. 自定义NSLog宏输出

    根据编译条件,Debug时输出带行号的日志,Release时关闭日志 /* XCode LLVM XXX - Preprocessing中Debug会添加 DEBUG=1 标志 */ #ifdef D ...

  8. 宏定义中的##操作符和... and _ _VA_ARGS_ _

    1.Preprocessor Glue: The ## Operator 预处理连接符:##操作符 Like the # operator, the ## operator can be used i ...

  9. 利用 __FUNCTION__ 宏打印函数调用信息

    __FUNCTION__ 宏表示当前所在函数名: __FILE__ 宏表示当前所在文件路径: __LING__ 宏表示当前所在行: 利用对象离开函数时调用析构函数销毁的特点,打印出函数执行结束的信息 ...

随机推荐

  1. freebsd启动报错:My unqualified host name unkown...Sleeping for retry.

    原文 http://blog.163.com/sujoe_2006/blog/static/335315120111158576591/ 病状:启动报"My unqualified host ...

  2. IT人可以关注的站

    问答平台 知乎 很杂但很专业的社区,就像标题说的:与世界分享你的知识.经验和见解 segmentfault 专业面向开发者的中文技术问答社区 德问 编程社交问答 V2EX 可以看到很多有意思对我这种I ...

  3. QStriingList

    #include <QCoreApplication> #include<QDebug> #include<QStringList> int main(int ar ...

  4. js中的逻辑与(&&)和逻辑或(||)(转载)

    var a = 2; var b = 3; var andflag = a && b ; var orflag = a || b; 问andflag 和orflag 分别是什么? 起初 ...

  5. JSTL 自定义标签

    编写描述标签的tld文件,把这个文件放到web-inf/目录下,才能在jsp页面上调用自定义的标签 package test.yz; import java.io.IOException; impor ...

  6. NSURLSession访问网络数据

    1.NSMutableURLRequest的设置 //创建NSMutableURLRequest对象 NSMutableURLRequest *request = [NSMutableURLReque ...

  7. Linux 下多用户申请git公钥方法

    问题:目前大家多是通过root用户来登录编译机,导致各自生成的公钥相互覆盖,而导致无法无法多人同时使用 解决方法: 登陆编译机添加用户   # useradd -m a00123456 进入切换为自己 ...

  8. javascript原型对象

    先来做个复习,ES5中有有几种数据类型呢? 5种基本数据类型 Undefined Null Boolean Number String 1种复杂数据类型 Object 除了基本数据类型,万物皆对象,记 ...

  9. 亿级Web系统搭建——单机到分布式集群

    当一个Web系统从日访问量10万逐步增长到1000万,甚至超过1亿的过程中,Web系统承受的压力会越来越大,在这个过程中,我们会遇到很多的问题.为了解决这些性能压力带来问题,我们需要在Web系统架构层 ...

  10. Coursera台大机器学习课程笔记6 -- The VC Dimension

    本章的思路在于揭示VC Dimension的意义,简单来说就是假设的自由度,或者假设包含的feature vector的个数(一般情况下),同时进一步说明了Dvc和,Eout,Ein以及Model C ...