I'm going through LazyFoo's Hello SDL tutorial, and any links to -lSDL2 and -lSDL2main fail to compile due to being "incompatible."
I have my environment variables set up to MinGW32\bin, SDL2-2.0.12\i686-w64-mingw32\include\SDL2 and SDL2-2.0.12\i686-w62-mingw32\bin, and I'm using the tutorial source code to compile. I had to write my own makefile, which is here:
OBJS = SDL2-window-tut.cpp
CC = g++
INCLUDE_PATHS = -IC:\mingw_dev_lib\SDL2-2.0.12\i686-w64-mingw32\include\SDL2
LIBRARY_PATHS = -LC:\mingw_dev_lib\SDL2-2.0.12\i686-w64-mingw32\lib
COMPILER_FLAGS = -std=c++11
LINKER_FLAGS = -lmingw32 -lSDL2main -lSDL2
OBJ_NAME = SDL2-window-tutorial.exe
all: $(OBJS)
$(CC) $(OBJS) $(INCLUDE_PATHS) $(LIBRARY_PATHS) $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OBJ_NAME)
When I try to compile I get the following kinds of error for every instance of SDL in the program:
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\mingw_dev_lib\SDL2-2.0.12\i686-w64-mingw32\lib/libSDL2main.a when searching for -lSDL2main
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2main
My g++ target is x86_64-w64-mingw32, which I know is the source of the problem, but I've run out of ways to fix it. Reinstalling MinGW32 didn't do anything, and I haven't found new information online. Anyone know what's up?