VS2017编译DirectX11的Effect框架时,出现C2323错误
来源:互联网 发布:生活中的帅哥知乎 编辑:程序博客网 时间:2024/05/29 13:21
d3dxGlobal.h中下列位置出错:
// Custom allocator that uses CDataBlockStore// The trick is that we never free, so we don't have to keep as much state around// Use PRIVATENEW in CEffectLoaderstatic void* __cdecl operator new(size_t s, CDataBlockStore &pAllocator){ D3DXASSERT(s <= 0xffffffff); return pAllocator.Allocate((UINT)s);}static void __cdecl operator delete(void* p, CDataBlockStore &pAllocator){}
MSDN的解释:
与VS的说明是差不多的,是因为新版的VS禁止全局static重载new/delete,只要把static [inline]去掉就可以了;
但是在Effect框架里,new 和delete都是在头文件中定义,是定义不是声明,改完之后框架是能编译通过,但是使用框架的时候会出现链接错误,需要把定义改为声明,然后在Cpp文件中定义:
//**************d3dxGlobal.h*****************// Custom allocator that uses CDataBlockStore// The trick is that we never free, so we don't have to keep as much state around// Use PRIVATENEW in CEffectLoader//static extern void* __cdecl operator new(size_t s, CDataBlockStore &pAllocator);//static extern void __cdecl operator delete(void* p, CDataBlockStore &pAllocator);
//**************d3dxGlobal.cpp***********************// Custom allocator that uses CDataBlockStore// The trick is that we never free, so we don't have to keep as much state around// Use PRIVATENEW in CEffectLoader//void* __cdecl operator new(size_t s, CDataBlockStore &pAllocator){ D3DXASSERT(s <= 0xffffffff); return pAllocator.Allocate((UINT)s);}//void __cdecl operator delete(void* p, CDataBlockStore &pAllocator){}
阅读全文
0 0
- VS2017编译DirectX11的Effect框架时,出现C2323错误
- Directx11 HelloWorld之HLSL的Effect框架的使用
- Directx11 HelloWorld之HLSL的Effect框架的使用
- Directx11 HelloWorld之HLSL的Effect框架的使用
- Directx11 HelloWorld之HLSL的Effect框架的使用
- 关于VS2017编译linux程序时,错误提示信息太简单,看不出错误原因的解决办法
- DirectX11 Effect特效文件
- 编译出现的错误
- 在编译VS2005时出现的错误
- 编译模板类时出现的错误
- 在编译VS2005时出现的错误
- linux内核编译时出现的错误
- 编译时出现的错误和解决办法
- 【7】编译python时出现的错误
- 编译内核时出现的错误
- 编译chromium时出现的错误
- VS2017编译jsoncpp我出现的问题及怎么解决的
- VS2017 远程调试linux出现的错误:Cannot access memory at address 0x570
- Date和String格式互转
- uLua 热更新 创建界面之后按钮点击事件问题
- 挑战程序竞赛系列(59):4.6树上的分治法(2)
- MongoDB serverStatus.globalLock 深入解析
- Spring与SpringMVC整合,以及实现数据库数据的增删查改和分页操作
- VS2017编译DirectX11的Effect框架时,出现C2323错误
- tensorflow的知识点一
- 如何选择数据类型
- 分布式与集群有什么区别
- python-tensorflow(1)C3D代码解析
- Linux文件属性与权限
- 【ORACLE】Oracle 11g RAC使用Manual和Policy Managed方法配置
- [Linux][RK3399] 以太网调试 — 利用 ping 和 pathping 工具
- 关于C#中在key不固定且不明的情况下遍历objec并取其值的方法