Using Visual Studio 2019

Leoreth

Blue Period
Moderator
Joined
Aug 23, 2009
Messages
37,060
Location
東京藝術大学
I'm currently setting up my compiler on a new laptop so I wanted to use the opportunity to also upgrade from VS 2010 to VS 2019. I left the rest of my setup unchanged (using @Nightinggale 's Makefile), but ran into the following errors:

Code:
1>Running fastdep
1>
1>Microsoft (R) Program Maintenance Utility Version 14.20.27508.1
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>
1>_precompile.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\sal.h(708): warning C4068: unknown pragma
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\sal.h(1472): warning C4068: unknown pragma
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(797): error C2144: syntax error : 'unsigned int' should be preceded by ';'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(797): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(812): error C2144: syntax error : 'unsigned int' should be preceded by ';'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(812): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(812): error C2086: 'int __inner_checkReturn' : redefinition
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(3839): error C2146: syntax error : missing ';' before identifier 'DWORD'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(3839): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(3839): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12156): error C2146: syntax error : missing ';' before identifier 'BOOL'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12156): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12156): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12164): error C2146: syntax error : missing ';' before identifier 'BOOL'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12164): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12164): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12212): error C2146: syntax error : missing ';' before identifier 'BOOL'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12212): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12212): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12223): error C2146: syntax error : missing ';' before identifier 'BOOL'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12223): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12223): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12233): error C2146: syntax error : missing ';' before identifier 'BOOL'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12233): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12233): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12254): error C2146: syntax error : missing ';' before identifier 'BOOL'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12254): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12254): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12263): error C2146: syntax error : missing ';' before identifier 'BOOL'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12263): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12263): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12283): error C2146: syntax error : missing ';' before identifier 'PTP_POOL'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12283): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12283): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12315): error C2146: syntax error : missing ';' before identifier 'PTP_CLEANUP_GROUP'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12315): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12315): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12456): error C2146: syntax error : missing ';' before identifier 'BOOL'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12456): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12456): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12467): error C2146: syntax error : missing ';' before identifier 'PTP_WORK'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12467): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12467): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12500): error C2146: syntax error : missing ';' before identifier 'PTP_TIMER'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12500): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12500): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12543): error C2146: syntax error : missing ';' before identifier 'PTP_WAIT'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12543): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12543): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12578): error C2146: syntax error : missing ';' before identifier 'PTP_IO'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12578): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinBase.h(12578): error C2370: '__inner_checkReturn' : redefinition; different storage class
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(777): error C2144: syntax error : 'int' should be preceded by ';'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(777): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(777): error C2086: 'int __inner_checkReturn' : redefinition
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(777): error C2143: syntax error : missing ';' before '__stdcall'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(777): error C2501: 'SC_HANDLE' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(777): error C2377: 'SC_HANDLE' : redefinition; typedef cannot be overloaded with any other symbol
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(407) : see declaration of 'SC_HANDLE'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(779): error C2146: syntax error : missing ')' before identifier 'hSCManager'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(779): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(779): error C2501: 'CreateServiceA' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(792): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(796): error C2144: syntax error : 'int' should be preceded by ';'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(796): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(796): error C2086: 'int __inner_checkReturn' : redefinition
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(796): error C2143: syntax error : missing ';' before '__stdcall'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(796): error C2501: 'SC_HANDLE' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(798): error C2146: syntax error : missing ')' before identifier 'hSCManager'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(798): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(798): error C2501: 'CreateServiceW' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(811): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(823): error C2146: syntax error : missing ')' before identifier 'hService'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(823): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(823): error C2491: 'DeleteService' : definition of dllimport data not allowed
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(823): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(828): error C2144: syntax error : 'int' should be preceded by ';'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(828): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(828): error C2086: 'int __inner_checkReturn' : redefinition
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(828): error C2143: syntax error : missing ';' before '__stdcall'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(828): error C2501: 'BOOL' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(828): error C2377: 'BOOL' : redefinition; typedef cannot be overloaded with any other symbol
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinDef.h(153) : see declaration of 'BOOL'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(830): error C2146: syntax error : missing ')' before identifier 'hService'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(830): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(830): error C2501: 'EnumDependentServicesA' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(837): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(841): error C2144: syntax error : 'int' should be preceded by ';'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(841): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(841): error C2086: 'int __inner_checkReturn' : redefinition
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(841): error C2143: syntax error : missing ';' before '__stdcall'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(841): error C2501: 'BOOL' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(843): error C2146: syntax error : missing ')' before identifier 'hService'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(843): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(843): error C2501: 'EnumDependentServicesW' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(850): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(860): error C2144: syntax error : 'int' should be preceded by ';'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(860): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(860): error C2086: 'int __inner_checkReturn' : redefinition
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(860): error C2143: syntax error : missing ';' before '__stdcall'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(860): error C2501: 'BOOL' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(862): error C2146: syntax error : missing ')' before identifier 'hSCManager'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(862): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(862): error C2501: 'EnumServicesStatusA' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(871): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(875): error C2144: syntax error : 'int' should be preceded by ';'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(875): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(875): error C2086: 'int __inner_checkReturn' : redefinition
1>        C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(796) : see declaration of '__inner_checkReturn'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(875): error C2143: syntax error : missing ';' before '__stdcall'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(875): error C2501: 'BOOL' : missing storage-class or type specifiers
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(877): error C2146: syntax error : missing ')' before identifier 'hSCManager'
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinSvc.h(877): fatal error C1003: error count exceeds 100; stopping compilation
1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Civ4SDK\Microsoft Visual C++ Toolkit 2003\bin\cl.exe"' : return code '0x2'
1>Stop.
1>
1>jom 1.1.0 - empower your cores
1>
1>CvArea.cpp
1>CvArea.cpp(3): fatal error C1083: Cannot open precompiled header file: 'temp_files\Release\CvGameCoreDLL.pch': No such file or directory
1>jom: C:\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Mods\RFC Dawn of Civilization\CvGameCoreDLL\Makefile [temp_files\Release\.\CvArea.obj] Error 2
Looks like something went wrong during the precompile stage but I don't really understand why. To make sure it's not the new laptop or any missing dependencies, I installed VS 2010 as well and was able to build without issues.
 
I haven't installed VS2019 and now I don't feel like doing so either :sad:

Code:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\sal.h(708): warning C4068: unknown pragma 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\sal.h(1472): warning C4068: unknown pragma
1>C:\Program Files (x86)\Civ4SDK\WindowsSDK\include\WinNT.h(797): error C2144: syntax error : 'unsigned int' should be preceded by ';'
The first error and sometimes the first warning(s) usually indicate very well what went wrong. In this case it tells that the error is in files provided by Microsoft. I will assume MS didn't decide to ship those commonly used files with failure to compile typos.

The only other issue I can think of is that it actually includes some 2019 header. It might have a modern syntax, which our ancient compiler doesn't understand. In other words the answer is likely the task I have been avoiding for ages, which is to add arguments to allow the makefile/compiler to run without any environment variables, hence getting rid of any reference of the 2019 compiler. The problem in doing so is that it isn't just getting rid of the 2019 compiler, but also some 2003 stuff, meaning it will require setting up a bunch of includes and paths which happens automatically right now. I don't even have a list of what I need to include manually if we take this path, but it looks like it this fix can't be postponed for long anymore :cry:
 
That sounds like there's no easy way to manually avoid using these 2019 files?

You mentioned using a more recent Visual Studio recently, was that 2017? For the time being I don't mind downgrading as long as it's not all the way back to 2010.
 
Okay great, I'll switch to that then. Thanks!
 
Finally had the chance to try this, unfortunately VS2017 shows the exact same behaviour. By the way, I am using the 2003 C++ Toolkit and Windows SDK from Asaf's guide, if that makes any difference. I'm quite at a loss what is happening here since as you said, VS2017 is known to be working for everyone else.

I'm trying to understand how different VS versions can even interfere here. The affected header file shown above comes with the platform SDK, and the error above sounds like it comes from the compiler (I have found some issues about this that pointed to GCC), but aren't we also using the 2003 compiler from the toolkit? Can I do anything to see which compiler is producing this error message?

Edit: I just noticed this in the output which I missed before because the paths where so similar until I reinstalled my platform SDK:
Code:
1>target PCH temp_files\Release\CvGameCoreDLL.pch
1>"D:\Dev\Microsoft Visual C++ Toolkit 2003\bin\cl.exe" /nologo /MD /O2 /Oy /Oi /G7 /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /DNDEBUG /DFINAL_RELEASE /GR /Gy /W3 /EHsc /Gd /Gm- /Fd"temp_files\Release\CvGameCoreDLL.pdb" /D_MOD_FRACTRADE /Yu"CvGameCoreDLL.h" /Fp"temp_files\Release\CvGameCoreDLL.pch" /I"Boost-1.32.0/include" /I"Python24/include" /I"D:\Dev\Microsoft Visual C++ Toolkit 2003/include" /I"D:\Dev\WindowsSDK/Include" /I"D:\Dev\WindowsSDK/Include/mfc" /YcCvGameCoreDLL.h /Fo"temp_files\Release\_precompile.obj" /c .\_precompile.cpp
1>_precompile.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\sal.h(708): warning C4068: unknown pragma
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\sal.h(1472): warning C4068: unknown pragma
1>D:\Dev\WindowsSDK\include\WinNT.h(797): error C2144: syntax error : 'unsigned int' should be preceded by ';'
1>D:\Dev\WindowsSDK\include\WinNT.h(797): error C2501: '__inner_checkReturn' : missing storage-class or type specifiers
Some googling indicates sal.h is Visual Studio's static code analysis which might just fail because it's being run on the way too old header files we're bringing in with the platform SDK?

I'm currently looking into how you can disable using this.

Edit2: I found a bunch of VS2017 source file paths in Project > CvGameCoreDLL Properties > Common Properties > Debug Source Files. I assume VS runs code analysis on these files as well, but after removing them I was able to successfully build the DLL without any errors.

Now trying the same for VS2019 but it's likely that it will be the same there and VS2019 is also compatible with the rest of the setup.
 
Last edited:
Strange, however I'm on Windows 10, whatever that may affect.
 
I was actually wrong in the above, what actually made it work was just installing VS2010 next to it. After I uninstalled it, my builds failed again. This is the same for VS2017 and VS2019. This is really baffling to me but at least I have a working setup.
 
I mean, I wouldn't totally rule out that there is just something strange going on in my system, but in case somebody has a similar issue it's at least something to try.
 
You probably need an older Windows SDK (like XP or 2003sp1), not the Vista SDK, to let newer Visual Studio do the right work.
Although higher Windows versions are said to be compatible with lower ones, you could have been easily messed up by newer Visual Studio not regarding your true SDK version...

Microsoft Platform SDK Trim.zip
I made this archive from the 2003sp1 SDK (installer was PSDK-amd64.exe), trimmed the contents in the same way as your provided SDK package.
Link to Microsoft download page (PSDK-x86 and PSDK-amd64 installers are available to choose from)

Discussions (the same problem as yours)
 
Last edited:
Nice, thank you. There are still some issues I have in my setup so maybe this helps me resolve them.
 
Top Bottom