RobLoach / raylib-cpp

C++ Object Oriented Wrapper for raylib
https://robloach.github.io/raylib-cpp/
zlib License
654 stars 85 forks source link

Issues while compiling with windows #336

Open hbardet opened 9 hours ago

hbardet commented 9 hours ago

Hello I have a project where i need to compile the raylib-cpp with cmake under linux and windows, no error on linux but windows it's different. I use Cmake to compile the project.

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h(
249,3): error C2365: 'Rectangle': redefinition; previous definition was 'function' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-M 
LH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\wingdi.h(4561,24):
      see declaration of 'Rectangle'

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h(
287,15): error C3646: 'source': unknown override specifier [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet 
\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
310,15): error C2143: syntax error: missing ';' before '*' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet 
\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
310,20): error C2238: unexpected token(s) preceding ';' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\bu 
ild\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
955,12): error C2733: 'CloseWindow': you cannot overload a function with 'extern "C"' linkage [C:\Users\Hugo\Documents\GitHub\ 
B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winuser.h(4710,1):
      see declaration of 'CloseWindow'

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1004,12): error C2733: 'ShowCursor': you cannot overload a function with 'extern "C"' linkage [C:\Users\Hugo\Documents\GitHub\ 
B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winuser.h(9328,1):
      see declaration of 'ShowCursor'

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1218,48): error C2061: syntax error: identifier 'Rectangle' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.barde 
t\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1241,12): error C2182: 'DrawRectangleRec': this use of 'void' is not valid [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-r 
type-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1241,12): error C2491: 'DrawRectangleRec': definition of dllimport data not allowed [C:\Users\Hugo\Documents\GitHub\B-CPP-500- 
MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1241,39): error C2146: syntax error: missing ')' before identifier 'rec' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rty 
pe-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1242,12): error C2182: 'DrawRectanglePro': this use of 'void' is not valid [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-r 
type-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1242,12): error C2491: 'DrawRectanglePro': definition of dllimport data not allowed [C:\Users\Hugo\Documents\GitHub\B-CPP-500- 
MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1242,39): error C2146: syntax error: missing ')' before identifier 'rec' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rty 
pe-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1245,12): error C2182: 'DrawRectangleGradientEx': this use of 'void' is not valid [C:\Users\Hugo\Documents\GitHub\B-CPP-500-ML 
H-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h(
1245,12): error C2491: 'DrawRectangleGradientEx': definition of dllimport data not allowed [C:\Users\Hugo\Documents\GitHub\B-C 
PP-500-MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1245,46): error C2146: syntax error: missing ')' before identifier 'rec' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rty 
pe-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1247,12): error C2182: 'DrawRectangleLinesEx': this use of 'void' is not valid [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5 
-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1247,12): error C2491: 'DrawRectangleLinesEx': definition of dllimport data not allowed [C:\Users\Hugo\Documents\GitHub\B-CPP- 
500-MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1247,43): error C2146: syntax error: missing ')' before identifier 'rec' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rty 
pe-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1248,12): error C2182: 'DrawRectangleRounded': this use of 'void' is not valid [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5 
-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1248,12): error C2491: 'DrawRectangleRounded': definition of dllimport data not allowed [C:\Users\Hugo\Documents\GitHub\B-CPP- 
500-MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1248,43): error C2146: syntax error: missing ')' before identifier 'rec' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rty 
pe-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1249,12): error C2182: 'DrawRectangleRoundedLines': this use of 'void' is not valid [C:\Users\Hugo\Documents\GitHub\B-CPP-500- 
MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1249,12): error C2491: 'DrawRectangleRoundedLines': definition of dllimport data not allowed [C:\Users\Hugo\Documents\GitHub\B 
-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1249,48): error C2146: syntax error: missing ')' before identifier 'rec' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rty 
pe-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1278,12): error C2491: 'CheckCollisionRecs': definition of dllimport data not allowed [C:\Users\Hugo\Documents\GitHub\B-CPP-50 
0-MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1278,41): error C2146: syntax error: missing ')' before identifier 'rec1' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rt 
ype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1280,66): error C2061: syntax error: identifier 'Rectangle' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.barde 
t\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1281,50): error C2061: syntax error: identifier 'Rectangle' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.barde 
t\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1287,7): error C2365: 'Rectangle': redefinition; previous definition was 'function' [C:\Users\Hugo\Documents\GitHub\B-CPP-500- 
MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\wingdi.h(4561,24):
      see declaration of 'Rectangle'

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1287,17): error C2146: syntax error: missing ';' before identifier 'GetCollisionRec' [C:\Users\Hugo\Documents\GitHub\B-CPP-500 
-MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1287,43): error C2146: syntax error: missing ')' before identifier 'rec1' [C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rt 
ype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')

C:\Users\Hugo\Documents\GitHub\B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\vcpkg_installed\x64-windows\include\raylib.h( 
1295,13): error C2733: 'LoadImageA': you cannot overload a function with 'extern "C"' linkage [C:\Users\Hugo\Documents\GitHub\ 
B-CPP-500-MLH-5-1-rtype-hugo.bardet\build\windows\src\Command\r-type-cmd.vcxproj]
  (compiling source file '../../../../src/Command/Commands/Game_info/Create_game/Create_game.cpp')
      C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\winuser.h(10848,1):
      see declaration of 'LoadImageA'

it's an extract from the error, I have many more. If you need more things tell me and I will give you.

kyomawolf commented 9 hours ago

If you have long error logs, please use something like pastebin in the future, makes it easier to communicate. It looks like its conflicting with wingdi.h, as stated in the error, please have a look at that

RobLoach commented 8 hours ago

If it works on Linux and not Windows, that's an indication that your build settings in Windows could use some work.