在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. C++ 利用 libxl 将 Excel 文件转化为 Xml 文件

    在游戏开发工作中,策划和运营一般会用Excel来编写配置文件,但是程序读取配置,最方便的还是xml文件.所以最好约定一个格式,然后在二者之间做一个转化. 本文利用libxl来读取Excel文件,利用 ...

  2. The shortest path---hdu2224 && Tour---poj2677(旅行商问题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2224 题意:平面上有n个点,问去的路只能从左到右,回的路只能从右到左的,且来回必须经过所有点的最小路径 ...

  3. 在Centos6下面安装Python3.4

    yum源里头好像没有python3.4 在Python的官网下载Python3.4的源代码 然后: 安装依赖包: yum groupinstall "Development tools&qu ...

  4. DevExpress XtraPivotGrid 交叉表 重复显示问题

    转自:http://www.cnblogs.com/xiayan/archive/2011/11/04/2236389.html 最近发现xtrareport 的PivotGrid实现交叉表非常的简单 ...

  5. LeetCode Logger Rate Limiter

    原题链接在这里:https://leetcode.com/problems/logger-rate-limiter/ 题目: Design a logger system that receive s ...

  6. linux配置tomcat以service方式启动(转)

    在/etc/init.d目录下新建文件,命名为tomcat 对tomcat文件进行编辑. cat /etc/init.d/tomcat #!/bin/bash # description: Tomca ...

  7. PPT图片双屏抽奖系统现场主要操作流程介绍

    目录 第一步:前期准备工作 第二步:现场预备与辅助展示工作 第三步:现场正式抽取工作 PPT图片双屏抽奖系统-现场抽奖视频实录 第一步:前期准备工作 把第二个步骤优化处理制作好的PPT文件 [图片.p ...

  8. shell脚本一

    在一些复杂的Linux维护工作中,大量重复的输入和交互操作不但费时费力,容易出错.这时候就需要用到脚本. 编写脚本的好处:  批量的处理,自动化的完成维护,减轻管理员的负担. linux的shell脚 ...

  9. python requests的安装与简单运用

    requests是python的一个HTTP客户端库,跟urllib,urllib2类似,那为什么要用requests而不用urllib2呢?官方文档中是这样说明的: python的标准库urllib ...

  10. Jquery父级节点追加

    <!-- 父节点追加 --><!DOCTYPE html><html lang="en"><script src="../../ ...