VS2003编译OGRE error C2065: '__in' : undeclared identifier 解决

 

编译所需要的东西

WinXP SP3 + MS VS 2003 + CMake 2.8 + Ogre 1.7.1 + Microsoft DirectX SDK (June 2010)+ OgreDependencies_MSVC_20100106.zip

编译时出现:

------ Build started: Project: RenderSystem_Direct3D9, Configuration: Release Win32 ------

Compiling...
cl : Command line warning D4002 : ignoring unknown option '/fp:fast'
OgreD3D9VideoModeList.cpp
D:\Works\DX9_SDK\Include\DxErr.h(26) : error C2065: '__in' : undeclared identifier
D:\Works\DX9_SDK\Include\DxErr.h(26) : error C2146: syntax error : missing ')' before identifier 'HRESULT'
D:\Works\DX9_SDK\Include\DxErr.h(26) : warning C4229: anachronism used : modifiers on data are ignored
D:\Works\DX9_SDK\Include\DxErr.h(26) : error C2059: syntax error : ')'
D:\Works\DX9_SDK\Include\DxErr.h(27) : error C3861: '__in': identifier not found, even with argument-dependent lookup
D:\Works\DX9_SDK\Include\DxErr.h(27) : error C2146: syntax error : missing ')' before identifier 'HRESULT'
D:\Works\DX9_SDK\Include\DxErr.h(27) : warning C4229: anachronism used : modifiers on data are ignored
D:\Works\DX9_SDK\Include\DxErr.h(27) : error C2059: syntax error : ')'
D:\Works\DX9_SDK\Include\DxErr.h(46) : error C3861: '__in': identifier not found, even with argument-dependent lookup
D:\Works\DX9_SDK\Include\DxErr.h(46) : error C2146: syntax error : missing ')' before identifier 'HRESULT'
D:\Works\DX9_SDK\Include\DxErr.h(46) : warning C4229: anachronism used : modifiers on data are ignored
D:\Works\DX9_SDK\Include\DxErr.h(46) : error C2059: syntax error : ')'
D:\Works\DX9_SDK\Include\DxErr.h(47) : error C3861: '__in': identifier not found, even with argument-dependent lookup
D:\Works\DX9_SDK\Include\DxErr.h(47) : error C2146: syntax error : missing ')' before identifier 'HRESULT'
D:\Works\DX9_SDK\Include\DxErr.h(47) : warning C4229: anachronism used : modifiers on data are ignored
D:\Works\DX9_SDK\Include\DxErr.h(47) : error C2059: syntax error : ')'
D:\Works\DX9_SDK\Include\DxErr.h(71) : error C2065: '__in_z' : undeclared identifier
D:\Works\DX9_SDK\Include\DxErr.h(71) : error C2143: syntax error : missing ')' before 'const'
D:\Works\DX9_SDK\Include\DxErr.h(71) : warning C4229: anachronism used : modifiers on data are ignored
D:\Works\DX9_SDK\Include\DxErr.h(71) : error C2059: syntax error : ')'
D:\Works\DX9_SDK\Include\DxErr.h(72) : error C3861: '__in_z': identifier not found, even with argument-dependent lookup
D:\Works\DX9_SDK\Include\DxErr.h(72) : error C2143: syntax error : missing ')' before 'const'
D:\Works\DX9_SDK\Include\DxErr.h(72) : warning C4229: anachronism used : modifiers on data are ignored
D:\Works\DX9_SDK\Include\DxErr.h(72) : error C2059: syntax error : ')'
d:\Works\OgreSources_1.7.2\OgreMain\include\OgreTexture.h(433) : fatal error C1903: unable to recover from previous error(s); stopping compilation
...

===========解决方法===========

在DxErr.h自定义

#define __in
#define __in_z
#define __in_z_opt

然后编译OK!

2,_wfindfirst不能将参数 1 从“const wchar_t *”转换为“wchar_t *"错误

将if ((f = _wfindfirst((Utf8ToUtf16((dir_name + file_pattern).c_str()).c_str()), &fd)) != -1)修改成

if ((f = _wfindfirst((wchar_t*)(Utf8ToUtf16((dir_name + file_pattern).c_str()).c_str()), &fd)) != -1)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值