3

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.

Community
  • 1
  • 1
user3346893
  • 153
  • 1
  • 1
  • 12
  • Welcome to Stack Overflow. Definitely looks like an include file issue. Reducing (or duplicating) the code to the smallest possible example that reproduces the issue will help both you and us get to the bottom of the problem. Pleas see http://www.stackoverflow.com/help/mcve. – jerry Feb 24 '14 at 14:18
  • 1
    @user3346893, in my case, problem resolved with including **atlbase.h** before **tchar.h**, **strsafe.h**, **Windows.h**. – neo Mar 29 '16 at 11:33

0 Answers0