使用Visual Studio 2013 Express为Windows XP构建错误

时间:2014-02-24 13:58:20

标签: c++ windows visual-studio windows-xp visual-studio-2013

编辑:解决了!见底部。

我正在尝试使我的C ++ / OpenGL游戏与Windows XP兼容。

目前我正在使用Visual Studio 2013 express。我按照说明here将平台工具集更改为v120_xp,但现在我在winbase.h和其他一些文件中遇到错误。

我的Windows特定包括:

#include <Windows.h>
#include <tchar.h> 
#include <strsafe.h>
#include <direct.h> 
#include <sys/types.h>
#include <dirent.h>

以下是我遇到的一些错误:

  

1&gt; C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v7.1A \ include \ winbase.h(6133):错误C2226:语法错误:意外类型'LPSTR'

     

1&gt; C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v7.1A \ include \ winbase.h(6141):错误C2226:语法错误:意外类型'LPWSTR'

     

1&gt; C:\ Program Files(x86)\ Microsoft SDKs \ Windows \ v7.1A \ include \ stralign.h(113):错误C2065:'wcscpy_instead_use_StringCchCopyW_or_StringCbCopyW':未声明的标识符

     

1&gt; C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ VC \ include \ cstdio(46):错误C2039:'_ _s_instead_use_StringCchGetsA_or_StringCbGetsA':不是'`global namespace''的成员

     

1&gt; C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ VC \ include \ cstring(20):错误C2039:'strcat_instead_use_StringCchCatA_or_StringCbCatA':不是'`global namespace''的成员

还有许多其他类似的错误。

我会提供更多代码,但这是一个非常大的项目。如果有任何具体需要,请告诉我。任何帮助将不胜感激!


解决方案:

在遵循杰瑞的建议时我明白了。

在我的一个文件中,我在Windows.h之前包含了tchar.h和strsafe.h

包括上面的Windows.h解决了这个问题。

0 个答案:

没有答案
相关问题