[原]__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__ 宏表示当前所在行: 利用对象离开函数时调用析构函数销毁的特点,打印出函数执行结束的信息 ...
随机推荐
- python-高阶函数
map函数 map(func, Iterable) , 返回一个Iterable的map对象 reduce函数 reduce(func,Iterable), 将后面可迭代对象的每个元素都作用于函数(函 ...
- 原生js实现网页触屏滑动
前言: 我有一个html格式的2048游戏,可以用键盘上下左右操作,但是放到手机上就抓瞎了.于是想修改一下代码,将键盘事件改成手机触屏事件. html5 的touch事件 html5支持touch事件 ...
- python 数据分析--词云图,图形可视化美国竞选辩论
这篇博客从用python实现分析数据的一个完整过程.以下着重几个python的moudle的运用"pandas",""wordcloud"," ...
- java实现删除文件以及文件夹
首先,需要明确的是File类中的delete()方法适用于删除空目录,或者单个文件. 然后,对于二级目录以上的文件夹的删除,需要分两步进行删除. 1.删除最底层目录下面的文件,或者空目录 当有多个文件 ...
- vim - copy/paste a word
1. http://stackoverflow.com/questions/7797068/copying-a-word-and-pasting-over-a-word viwp - visually ...
- jQuery.ajax( options ) : 通过 HTTP 请求加载远程数据
jQuery.ajax( options ) : 通过 HTTP 请求加载远程数据 这个是jQuery 的底层 AJAX 实现.简单易用的高层实现见 $.get, $.post 等. $.ajax() ...
- LVM 'Can’t open /dev/sdb1 exclusively. Mounted filesystem?' Problem
服务器做mysql时候,添加的新磁盘做lvm时候,创建物理卷报错 saltstack_s:/proc/scsi # cat /proc/partitions major minor #blocks n ...
- socket编程进阶
1. 动态导入模块 第一种方法(python解释器自己内部用的): 上图是我程序的目录结构 下面代码是动态导入模块3.py的源码: #AUTHOR:FAN lib_dir = __import__ ...
- css给div添加0.5px的边框
具体代码实现如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...
- Git的.gitignore文件配置
.gitignore是Git工具的配置文件,用于屏蔽某些文件上传到线上. 创建.gitignore 在window系统中,不允许新建文件名以"."开头的文件,所以通过git bas ...