[原]__FILE__宏
在vs中__FILE__宏代表了当前文件,如果有/FC那么__FILE__代表了当前文件的全路径!否则只表示当前文件名
/FC (Full Path of Source Code File in Diagnostics)

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.
[原]__FILE__宏的更多相关文章
- #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #endif
情况1:#ifdef _DEBUGvirtual void AssertValid() const; //assert(断言)valid(有效的,正确的)virtual ...
- C语言 第八章 函数、指针与宏
一.函数 函数是一个包含完成一定功能的执行代码段.我们可以把函数看成一个"黑盒子", 你只要将数据送进去就能得到结果, 而函数内部究竟是如何工作的的, 外部程序是不知道的.外部程序 ...
- VC中预处理指令与宏定义详解
刚接触到MFC编程的人往往会被MFC 向导生成的各种宏定义和预处理指令所吓倒,但是预处理和宏定义又是C语言的一个强大工具.使用它们可以进行简单的源代码控制,版本控制,预警或者完成一些特殊的功能. 一个 ...
- C++ 中常见预定义宏的使用
http://blog.csdn.net/hgl868/article/details/7058906 替代字符串: #define DOWNLOAD_IMAGE_LOG /var/log/png.l ...
- C++ 中宏的使用 --来自:http://blog.csdn.net/hgl868/article/details/7058906
宏在代码中的使用实例: g_RunLog2("Middleware client for Linux, build:%s %s", __DATE__, __TIME__); 下面详 ...
- 20个C语言中常用宏定义总结
01: 防止一个头文件被重复包含 #ifndef COMDEF_H#define COMDEF_H//头文件内容#endif 02: 重新定义一些类型防止由于各种平台和编译器的不同,而产生的类型字节数 ...
- 自定义NSLog宏输出
根据编译条件,Debug时输出带行号的日志,Release时关闭日志 /* XCode LLVM XXX - Preprocessing中Debug会添加 DEBUG=1 标志 */ #ifdef D ...
- 宏定义中的##操作符和... and _ _VA_ARGS_ _
1.Preprocessor Glue: The ## Operator 预处理连接符:##操作符 Like the # operator, the ## operator can be used i ...
- 利用 __FUNCTION__ 宏打印函数调用信息
__FUNCTION__ 宏表示当前所在函数名: __FILE__ 宏表示当前所在文件路径: __LING__ 宏表示当前所在行: 利用对象离开函数时调用析构函数销毁的特点,打印出函数执行结束的信息 ...
随机推荐
- Notification中使用Glide
之前一直在琢磨Glide自定义使用中的一些经验:今天简单的分享下Notification中使用Glide去加载icon方法: 我们都知道使用android通知时,一般可能会有如下代码: Notific ...
- json转bean对象
一下为个人收藏,以便下次使用. 前端传的json格式为: [{"suppliercode":"gylhld_gycqlt3_gycqlt1","pro ...
- php try catch throw 用法
1.try catch 捕捉不到fatal error致命错误 2.只有抛出异常才能被截获,如果异常抛出了却没有被捕捉到,就会产生一个fatal error. 3.父类可以捕获抛出的子类异常,Exce ...
- iOS推送遇到的问题
1. 推送证书过期. 同事说iOS客户端不能推送消息,发现推送证书过期了,苹果的推送证书有效期是一年,推送证书过期后就不能使用推送服务了.解决办法:重新请求推送证书,导出p12文件,传给后台服务器就可 ...
- JMeter学习(三十五)使用jmeter来发送json/gzip格式数据
一.使用jmeter来发送gzip数据 有时候我们需要模拟在客户端将数据压缩后, 发送(post)到服务器端. 通常这种情况,会发生在移动终端上. 这样做的好处, 是可以节省流量. 当然, 服务器返 ...
- Spring操作指南-针对JDBC配置声明式事务管理(基于注解)
- Python之路-jQuery
参考网址:http://jquery.cuishifeng.cn/ 1.安装环境 2.查找元素 3.操作元素 一.安装环境: 1.我们需要去官网下载jQuery,地址:http://jquery.co ...
- NOI 05:最高的分数描述
描述 孙老师讲授的<计算概论>这门课期中考试刚刚结束,他想知道考试中取得的最高分数.因为人数比较多,他觉得这件事情交给计算机来做比较方便.你能帮孙老师解决这个问题吗? 输入输入两行,第一行 ...
- grunt 入门学习
前端工作流,Grunt上手指南 Posted@2013-04-20 7:15 a.m. CategoriesGrunt , javascript 我想先花点时间回忆一下作为一个前端需要做的工作(Lo ...
- JDBC基础与连接sql2012
JDBC简介 JDBC全称为:Java Data Base Connectivity(java数据库连接),它主要由接口组成. 组成JDBC的2个包: java.sql javax.sql 以上2个包 ...