RobLoach / RobLoach/raylib-cpp

Issues while compiling with windows

Aperta
#336 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C++
Stelle
960
Fork
120
Merge medio
10m
PR unite (30g)
1

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Start by reproducing the Windows CMake build for src/Command/Commands/Game_info/Create_game/Create_game.cpp and inspect how raylib.h is included alongside the Windows SDK headers. Compare the Linux and Windows build configuration and include setup. Done means the project compiles on Windows without the reported raylib.h and Windows header conflicts.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cmake, cpp
Ambito
build-system, operating-systems
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.