Question

EDIT: Solved! See bottom.

I am trying to make my C++/OpenGL game compatible with windows XP.

Currently I am using Visual Studio 2013 express. I followed the instructions here and changed the Platform Toolset to v120_xp, but now I am getting errors in winbase.h and some other files.

My windows specific includes look like this:

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

Here are some of the errors I am getting:

1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\winbase.h(6133): error C2226: syntax error : unexpected type 'LPSTR'

1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\winbase.h(6141): error C2226: syntax error : unexpected type 'LPWSTR'

1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\stralign.h(113): error C2065: 'wcscpy_instead_use_StringCchCopyW_or_StringCbCopyW' : undeclared identifier

1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\cstdio(46): error C2039: '_gets_instead_use_StringCchGetsA_or_StringCbGetsA' : is not a member of '`global namespace''

1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\cstring(20): error C2039: 'strcat_instead_use_StringCchCatA_or_StringCbCatA' : is not a member of '`global namespace''

There are many other similar errors.

I would provide more code but this is quite a large project. If there is anything specific you need let me know. Any help would be appreciated!


Solution:

I figured it out when following Jerry's advice.

In one of my files I was including tchar.h and strsafe.h before Windows.h

Including Windows.h above them solved the problem.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top