你到代码里搜索 THIS_FILE看是不是它定义在别的头文件前面了,如果是,把它们的头文件紧跟到Stdafx.h后面


我遇到过这问题,这样搞定的

今天遇到个编译错误:..\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE',我的某个.cpp中是这样写的:

#include "stdafx.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

#include "myUtil.h"

百度了下说是#include顺序问题,要放到'THIS_FILE'定义之前,改成如下即可:

#include "stdafx.h"

#include "myUtil.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

C++编译错误syntax error : identifier 'THIS_FILE' 解决方法的更多相关文章

  1. xcode工程编译错误:missing required architecture i386 解决方法

    可能原因一:项目内保存了.framework文件,在复制分发到不同计算机的时候可能会引发该错误 解决方法一:来到Targets->Build Settings->Framework Sea ...

  2. zlib编译不过(Error A2070)解决方法(转)

    原文转自 http://dearymz.blog.163.com/blog/static/2056574200871010027435/ 1.zlib是个很牛的东东,从http://www.zlib. ...

  3. VS2012与VS2015同时安装用VS2012创建MFC程序时弹出编译错误”fatal error C1083: 无法打开包括文件:“mprapidef.h”: No such file or directory”的解决办法

    在WIndows 7操作系统上同时安装VS2012与VS2015并用VS2012创建MFC程序时弹出编译错误”fatal error C1083: 无法打开包括文件:“mprapidef.h”: No ...

  4. vs2008编译错误fatal error C1902: 程序数据库管理器不匹配;请检查安装解决

    重装了本本上的Xp系统,如往常一样,升级,装杀毒软件,开发工具.一些进行的非常顺利.然而,在我打开VS2008准备耕作的时候,尽然出现了一邪恶的错误提示:vs2008编译错误fatal error C ...

  5. myeclipse中导入js报如下错误Syntax error on token "Invalid Regular Expression Options", no accurate correc

    今天在使用bootstrap的时候引入的js文件出现错误Syntax error on token "Invalid Regular Expression Options", no ...

  6. AspNetPager控件报错误: Syntax error, unrecognized expression: input#ctl00$ContentPlaceHolder1$Aspnetpager1_input问题解决[摘]

    高版本IE,如IE10或者IE11在浏览页面时出现错误: Syntax error, unrecognized expression: input#ctl00$ContentPlaceHolder1$ ...

  7. 编译错误:error: multi-line comment

    编译错误:error: multi-line comment  这其实是有宏定义的地方的问题. 原因是宏定义非一行,在宏定义的行尾使用 '\' 连接符导致的. 所以这个地方的注释使用 /*   */ ...

  8. VS2017编译错误:#error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version

    VS2017编译错误:#error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll ve ...

  9. algorithm.sty not found error in LaTeX 解决方法

    参考: algorithm.sty not found error in LaTeX algorithm.sty not found error in LaTeX 解决方法 错误日志: LaTeX E ...

随机推荐

  1. DB2 组内分组排序,游标使用

    CREATE PROCEDURE Sys_Init_tblaccountsuser_sortid () P1: BEGIN '; ; ; ; DECLARE CUR1 CURSOR WITH RETU ...

  2. js 标签云效果

    下载:http://files.cnblogs.com/zjfree/js_tag_list.rar 效果如下: 源码如下: <html> <head> <meta ht ...

  3. Redis容灾部署(哨兵Sentinel)

    Redis容灾部署(哨兵Sentinel) 哨兵的作用 1. 监控:监控主从是否正常2. 通知:出现问题时,可以通知相关人员3. 故障迁移:自动主从切换4. 统一的配置管理:连接者询问sentinel ...

  4. Python函数,参数,变量

    func1.py def sayHello(): print ('hello world') sayHello() func_parm.py def printMax(a,b): if a>b: ...

  5. [Freescale]E9学习笔记-LTIB安装配置

    转自:http://blog.csdn.net/girlkoo/article/details/44535979 LTIB: Linux Target Image Builder Freescale提 ...

  6. 访问修饰符protected

    protected(C# 参考) protected 关键字是一个成员访问修饰符. 受保护成员在其所在的类中可由派生类实例访问. 示例只有在通过派生类访问时,基类的受保护成员在派生类中才是可访问的. ...

  7. org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.String

    org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.Strin ...

  8. 基于redis的分布式锁

    <?php /** * 基于redis的分布式锁 * * 参考开源代码: * http://nleach.com/post/31299575840/redis-mutex-in-php * * ...

  9. Calculations are rather interesting

    Calculations are rather interesting, especially when some thoughts are involved therein.

  10. PHP解析JSON和XML方法

    一.JSON $r = json_decode("json数据"); $result = $r->result; //解析后的数据,以数组形式保存到r里面了,需要通过-> ...