phoboslab / wipeout-rewrite

2.6k stars 198 forks source link

numerous errors when building using MSVC compiler on Windows #117

Open SingingBush opened 5 months ago

SingingBush commented 5 months ago

I'm aware that MSVC isn't supposed to work currently but thought it's worth creating an issue. Perhaps supporting MSVC can be done at some point.

I ran the following on Windows using MSVC compiler targeting x64-windows with cmake version 3.27.9 and SDL2 etc installed via vcpkg:

cmake -S D:\a\wipeout-rewrite\wipeout-rewrite -B D:\a\wipeout-rewrite\wipeout-rewrite/build -DPLATFORM=SDL2 -DRENDERER=GL -DCMAKE_CXX_COMPILER= -DCMAKE_C_COMPILER=cl -DCMAKE_BUILD_TYPE=Release  -DCMAKE_PREFIX_PATH="C:/vcpkg/packages/glew_x64-windows;C:/vcpkg/packages/sdl2_x64-windows"

In the build output there are a lot of warnings & errors, such as:

D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(604,14): error C2059: syntax error: '{' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(604,14): warning C4013: '__typeof__' undefined; assuming extern returning int [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(604,14): error C2146: syntax error: missing ';' before identifier '_b' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(604,14): error C2065: '_b': undeclared identifier [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(604,14): error C2065: '_a': undeclared identifier [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(604,14): error C2059: syntax error: ')' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(605,2): error C2059: syntax error: 'if' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(608,21): warning C4131: 'ui_set_scale': uses old-style declarator [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(608,21): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(608,2): error C2371: 'ui_set_scale': redefinition; different basic types [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\ui.h(39,6): message : see declaration of 'ui_set_scale' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(608,21): warning C4218: nonstandard extension used: must specify at least a storage class or a type [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(611,2): error C2059: syntax error: 'if' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(623,2): error C2059: syntax error: 'if' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(628,7): error C2099: initializer is not a constant [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(629,2): error C2059: syntax error: 'if' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(634,2): error C2059: syntax error: 'if' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(642,9): error C2099: initializer is not a constant [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(643,3): error C2143: syntax error: missing '{' before '.' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(643,3): error C2059: syntax error: '.' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(644,2): error C2059: syntax error: 'if' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
D:\a\wipeout-rewrite\wipeout-rewrite\src\wipeout\game.c(647,1): error C2059: syntax error: '}' [D:\a\wipeout-rewrite\wipeout-rewrite\build\wipeout.vcxproj]
  hud.c