zoukankan      html  css  js  c++  java
  • Directx报错01

    --------------------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>

  • 相关阅读:
    [APIO2018]铁人两项 --- 圆方树
    SPOJ1811 && SPOJ1812
    [BZOJ4627][BeiJing2016]回转寿司(线段树)
    NOIP2018提高组题解
    [BZOJ4340][BJOI2015]隐身术(后缀数组)
    [BZOJ4338][BJOI2015]糖果(扩展Lucas)
    [BZOJ4336][BJOI2015]骑士的旅行(树链剖分+线段树)
    [BZOJ4419][SHOI2013]发微博
    [BZOJ2878][NOI2012]迷失游乐园(环套树DP+概率)
    [BZOJ1791][IOI2008]Island岛屿(环套树DP)
  • 原文地址:https://www.cnblogs.com/carl2380/p/1924663.html
Copyright © 2011-2022 走看看