SDL + MinGW Linker errors

OK, so I normally write and compile my programs on Linux, but I wanted to make sure that my program worked on Windows, so I installed Windows XP in a VM (Virtual Box), installed all the updates, and installed MinGW, MSYS, SDL, SDL_image & SDL_gfx. I have a Makefile:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
SRC=$(wildcard ./*.cpp)
OBJS=$(SRC:.cpp=.o)
CFLAGS=`sdl-config --cflags` -Wall
LIBS=`sdl-config --libs` -lSDL_image -lSDL_gfx

asteroids: $(OBJS)
	$(CXX) $(LIBS) $(OBJS) -o asteroids

%.o: %.cpp *.h
	$(CXX) $(CFLAGS) -o $@ -c $<

clean:
	rm -f asteroids
	rm -f *.o

.PHONY: clean */


When I run "make" in the msys terminal, I get a lot of this:
./main.o:main.cpp(.text+0x1e2): undefined reference to`SDL_SetVideoMode'
It does that for every occurence of an SDL function in my code.

My code can be found here: https://code.launchpad.net/~jordy-d/+junk/asteroids
It is slightly outdated, as main is actually defined as this in my local copy: int main(int argc, char *argv[])

Tell me if I've left anything out.

Thanks,
JCED
Last edited on
Topic archived. No new replies allowed.