I'm trying to statically link sdl2 for windows and linux.
Here's my current makefile:
Code:
When I make for linux everything works fine, but when i make for windows i get the following errors:
Code:
here's the github repo if it helps. I'm running linux mint
Any help is much appreciated!
Here's my current makefile:
Code:
EXE_FILE = bin/MapJumper
OBJ_FILES = obj/main.o
FLAGS = --std=c++17 -w -fpermissive
CC = g++
exe : clean
exe : $(EXE_FILE)
debug: FLAGS += -ggdb
debug : exe
windows: EXE_FILE = bin/mapJumper.exe
windows: CC = x86_64-w64-mingw32-g++
windows: exe
$(EXE_FILE) : $(OBJ_FILES)
$(CC) -o $(EXE_FILE) $(OBJ_FILES) $(FLAGS) `pkg-config --static --libs sdl2 SDL2_image SDL2_ttf SDL2_mixer` -lSDL2main
obj/main.o : src/main.cpp src/bounds.h src/player.h src/texture.h src/world.h
$(CC) -c -o obj/main.o src/main.cpp $(FLAGS)
run : exe
$(EXE_FILE) &
clean:
rm -f *.o obj/main.o
When I make for linux everything works fine, but when i make for windows i get the following errors:
Code:
jc@jc-Inspiron-560:~/Desktop/c++Dev/Map Jumper$ make windows
rm -f *.o obj/main.o
x86_64-w64-mingw32-g++ -c -o obj/main.o src/main.cpp --std=c++17 -w -fpermissive
x86_64-w64-mingw32-g++ -o bin/mapJumper.exe obj/main.o --std=c++17 -w -fpermissive `pkg-config --static --libs sdl2 SDL2_image SDL2_ttf SDL2_mixer` -lSDL2main
/usr/bin/x86_64-w64-mingw32-ld: cannot find -ldl
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lasound
/usr/bin/x86_64-w64-mingw32-ld: cannot find -ldl
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpulse-simple
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lpulse
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lX11
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lXext
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lXcursor
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lXinerama
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lXi
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lXrandr
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lXss
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lXxf86vm
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lwayland-egl
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lwayland-client
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lwayland-cursor
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lxkbcommon
/usr/bin/x86_64-w64-mingw32-ld: cannot find -lrt
collect2: error: ld returned 1 exit status
make: *** [Makefile:17: bin/MapJumper] Error 1
jc@jc-Inspiron-560:~/Desktop/c++Dev/Map Jumper$
here's the github repo if it helps. I'm running linux mint
Any help is much appreciated!