在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. Java中PreparedStatement与Statement的总结

    概要: PreparedStatement 接口继承自 Statement 接口,PreparedStatement 比普通Statement 对象使用起来更加灵活,更有效率. 一.PreparedS ...

  2. manifest中读取<meta-data>

    meta-data在清单文件中主要有以下用法: <application>       <meta-data android:value="a1" android ...

  3. wordpress取文章时间

    wordpress的时间处理, 取文章的本地时间用get_the_time('c'),其中c可以用“D, d M Y H:i:s"等替代. 取文章的UTC时间用get_post_time(' ...

  4. Spring 核心框架体系结构

    转载:http://www.admin10000.com/document/10447.html 很多人都在用spring开发java项目,但是配置maven依赖的时候并不能明确要配置哪些spring ...

  5. LoadRunner调用Oracle存储过程

    为了测试这个存储过程,我遥了一圈去做这个事情,这里说一下我自己接受到任务和自己开始是怎么想的. 方法一: 一开始我想着可以使用C#直接去调用存储过程,然后用Loadrunner调用C#的dll去测试, ...

  6. win10快速开机

    百度经验:jingyan.baidu.com 在win8系统出现以后的win系统中,都有一个特点,那就是快速启动,可是,相信大家都有这样一个问题,就是,自己明明用的是win8(或者win10)系统,可 ...

  7. RDIFramework.NET ━ .NET快速信息化系统开发框架 V3.0 版新增消息管理

    在V3.0版本的Web(Mvc.WebForm)与WinForm中我们新增了“消息管理”模块.“消息管理”模块是对框架的所有消息进行管理.通过左侧的消息分类可以查看所选分类的所有消息列表.在主界面上我 ...

  8. mysql的三种驱动类型

    http://862123204-qq-com.iteye.com/blog/1566581 1. Class.forName("com.mysql.jdbc.Driver");/ ...

  9. C语言第五次作业

    #include<stdio.h> int main() { int a,b,c; printf("请输入3个整数:"); scanf("%d %d %d&q ...

  10. PHP中GPC

    PS:PHP中绕过GPC的情况有很多,本文仅仅是总结了一些比较常见的,而且写的很浅[因为本人水平有限],欢迎大家积极拍砖:) 1.通过数据库(文本)中转 通过数据库中转: [注意存入数据库和selec ...