libsdl-org / Maelstrom

Maelstrom 3.0
Other
13 stars 7 forks source link

MSYS2 - libSDL2main.a(SDL_windows_main.c.obj):(.text+0x17a): undefined reference to `SDL_main' #4

Open shoober420 opened 4 days ago

shoober420 commented 4 days ago

Im trying to compile using MSYS2 on Windows 11 using this PKGBUILD file.

https://github.com/shoober420/windows-configs/blob/main/C:/msys2/home/shoober420/maelstrom-git/PKGBUILD

Im getting the following error.

-march=native -msahf -O3 -pipe -fno-plt -fno-common -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fexcess-precision=fast -flto=auto -march=native -msahf -O3 -pipe -fno-plt -fno-common -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fexcess-precision=fast -flto=auto -IC:/msys64/mingw64/include/SDL2 -Dmain=SDL_main -I.. -I../netlogic -I../screenlib -I../maclib -DLIBDIR=\".\" -o snd2wav.exe snd2wav.o libSDLmac.a -lmingw32 -mwindows -lSDL2main -lSDL2 -lSDL2_net C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../lib/libSDL2main.a(SDL_windows_main.c.obj):(.text+0x17a): undefined reference to `SDLmain' collect2.exe: error: ld returned 1 exit status make[1]: [Makefile:385: snd2wav.exe] Error 1 make[1]: Waiting for unfinished jobs.... make[1]: Leaving directory '/home/RavenWolf-/maelstrom-git/src/Maelstrom/maclib' make: *** [Makefile:561: all-recursive] Error 1 ==> ERROR: A failure occurred in build(). Aborting...

Full Build Log: log.txt

slouken commented 4 days ago

I don't have this build environment, so I'm not sure exactly what's happening, but you can just remove snd2wav from the build, it's not actually used by the game.

shoober420 commented 4 days ago

How should I go about disabling snd2wav? I tried to search for a "--disable-snd2wav" build flag in the Makefiles and configure files and couldnt come across any build flags.

shoober420 commented 3 days ago

I went through Makefile, Makefile.am, Makefile.in, configure, and configure.in files in src directory and removed all traces of "maclib". I now get this build error.

compilation terminated. In file included from player.cpp:2: ../Maelstrom_Globals.h:5:10: fatal error: Mac_FontServ.h: No such file or directory 5 | #include "Mac_FontServ.h" | ^~~~

Full Build Log: buildlog.txt

shoober420 commented 3 days ago

I removed traces of snd2wav from maclib directory Makefile, Makefile.am, and Makefile.in files, and now receive this build error.

-march=native -msahf -O3 -pipe -fno-plt -fno-common -fipa-pta -falign-functions=32 -fdevirtualize-at-ltrans -fuse-linker-plugin -floop-nest-optimize -fgraphite-identity -fexcess-precision=fast -flto=auto -IC:/msys64/mingw64/include/SDL2 -Dmain=SDL_main -I. -I./netlogic -I./screenlib -I./maclib -DLIBDIR=\".\" -MT Maelstrom-netd.o -MD -MP -MF .deps/Maelstrom-netd.Tpo -c -o Maelstrom-netd.o Maelstrom-netd.c mv -f .deps/rect.Tpo .deps/rect.Po Maelstrom-netd.c:11:10: fatal error: sys/socket.h: No such file or directory 11 | #include <sys/socket.h> | ^~~~~~ compilation terminated. fastrand.cpp: In function 'Uint16 FastRandom(Uint16)': fastrand.cpp:33:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregiste ] 33 | register Uint32 calc; | ^~~~ fastrand.cpp:34:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregiste ] 34 | register Uint32 regD0; | ^~~~~ fastrand.cpp:35:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregiste ] 35 | register Uint32 regD1; | ^~~~~ fastrand.cpp:36:25: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregiste ] 36 | register Uint32 regD2; | ^~~~~

Full build log: buildlog.txt