博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Directx报错01
阅读量:4687 次
发布时间:2019-06-09

本文共 1715 字,大约阅读时间需要 5 分钟。

--------------------Configuration: LDCTextCtrl - Win32 Debug--------------------

Compiling...

LDCTextControl.cpp

d3dx9math.h(392) : error C2061: syntax error : identifier 'THIS_FILE'

d3dx9math.h(392) : error C2091: function returns function

d3dx9math.h(392) : error C2802: static member 'operator new' has no formal parameters

d3dx9math.h(393) : error C2061: syntax error : identifier 'THIS_FILE'

d3dx9math.h(393) : error C2090: function returns array

d3dx9math.inl(990) : error C2061: syntax error : identifier 'THIS_FILE'

d3dx9math.inl(991) : error C2091: function returns function

d3dx9math.inl(992) : error C2065: 's' : undeclared identifier

d3dx9math.inl(1005) : error C2061: syntax error : identifier 'THIS_FILE'

d3dx9math.inl(1005) : error C2090: function returns array

d3dx9math.inl(1006) : error C2084: function 'void *(__cdecl *__cdecl _D3DXMATRIXA16::operator new(void))(unsigned int)' already has a body

 

d3dx9math.h(392) :原因

关于宏与头文件错误的冲突问题的解决

宏与头文件错误的冲突问题

 

在文件test7Dlg.cpp当有如下定义时:

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include <vector>
就会出现如下错误:

 

1。把#include <vector>语句放在test7Dlg.h文件中

2。把定义顺序颠倒下,如下所示:
#include <vector>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
原因:
VC6
是可以支持的,不过头文件的声明
#include <list>
using namespace std;
要在系统生成的代码
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
之前

 

 

所以:要把

#include "d3dUtility.h"

语句放在

#ifdef _DEBUG

#undef THIS_FILE

static char THIS_FILE[]=__FILE__;

#define new DEBUG_NEW

#endif 之前,因为

 

"d3dUtility.h"首先

#include <d3dx9.h>

//#include <string>

 

 

转载于:https://www.cnblogs.com/carl2380/archive/2011/01/13/1934341.html

你可能感兴趣的文章
第一次使用maven记录
查看>>
SharePoint服务器端对象模型 之 使用CAML进展数据查询
查看>>
Building Tablet PC Applications ROB JARRETT
查看>>
Adobe® Reader®.插件开发
查看>>
【POJ 3461】Oulipo
查看>>
Alpha 冲刺 (5/10)
查看>>
使用Siege进行WEB压力测试
查看>>
斑马为什么有条纹?
查看>>
android多层树形结构列表学习笔记
查看>>
Android_去掉EditText控件周围橙色高亮区域
查看>>
《构建之法》第一、二、十六章阅读笔记
查看>>
Pandas基础(十一)时间序列
查看>>
arrow:让Python的日期与时间变的更好
查看>>
MySQL命令行参数
查看>>
MFC中 用Static控件做超链接(可以实现变手形、下划线、字体变色等功能)
查看>>
20144303 《Java程序设计》第五周学习总结
查看>>
多线程(第三天)
查看>>
python 抓取小说网站,制作电子书。
查看>>
restframework视图三部曲
查看>>
失去光标display=none事件的坑
查看>>