raylib-extras / game-premake

premake system for use in making raylib game projects
189 stars 46 forks source link

Can't build on Windows with mingw (w64devkit) #14

Closed kglundgren closed 2 years ago

kglundgren commented 2 years ago

The premake-mingw.bat file works fine. But when I run the make command I get loads of "undefined reference" errors.

==== Building raylib (debug_x64) ====
raudio.c
In file included from ../raylib-master/src/raudio.c:211:
../raylib-master/src/external/jar_xm.h:242: warning: "DEBUG" redefined
  242 | #define DEBUG(...)
      |
<command-line>: note: this is the location of the previous definition
rcore.c
rglfw.c
rmodels.c
rshapes.c
rtext.c
rtextures.c
utils.c
Linking raylib
==== Building game-premake-main (debug_x64) ====
raylib_game.c
screen_ending.c
screen_gameplay.c
screen_logo.c
screen_options.c
screen_title.c
Linking game-premake-main
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
C:/dev/w64devkit/bin/ld.exe: c:/dev/w64devkit/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-merr.o):merr.c:(.text+0xbb): undefined reference to `fprintf'
C:/dev/w64devkit/bin/ld.exe: ../_bin/Debug/raylib.lib(rtextures.obj):(.text$mn+0x25): undefined reference to `__CheckForDebuggerJustMyCode'
C:/dev/w64devkit/bin/ld.exe: ../_bin/Debug/raylib.lib(rtextures.obj):(.text$mn+0x1f): undefined reference to `__CheckForDebuggerJustMyCode'
C:/dev/w64devkit/bin/ld.exe: ../_bin/Debug/raylib.lib(rtextures.obj):(.text$mn+0x1b): undefined reference to `__CheckForDebuggerJustMyCode'
JeffM2501 commented 2 years ago

What version of the w64Devkit are you using and on what platform? I've never seen that error. The fact that a file is corrupted is very troubling and most likely the cause of the issue. I'd delete your build folder and makefile and regenerate it from the batch file.

Peter0x44 commented 2 years ago
C:/dev/w64devkit/bin/ld.exe: ../_bin/Debug/raylib.lib(rtextures.obj):(.text$mn+0x25): undefined reference to `__CheckForDebuggerJustMyCode'
C:/dev/w64devkit/bin/ld.exe: ../_bin/Debug/raylib.lib(rtextures.obj):(.text$mn+0x1f): undefined reference to `__CheckForDebuggerJustMyCode'
C:/dev/w64devkit/bin/ld.exe: ../_bin/Debug/raylib.lib(rtextures.obj):(.text$mn+0x1b): undefined reference to `__CheckForDebuggerJustMyCode'

these definitely don't look like symbols that should be in raylib

the .lib is not correct either, I think it should be .a and uh yeah, those corrupt warnings do not look good

kglundgren commented 2 years ago

I'd delete your build folder and makefile and regenerate it from the batch file.

Yep, that was it, it had nothing to do with game-premake itself. After redownloading everything it worked fine. Sorry to waste your time.