SDL and C++ Classes

Started by
9 comments, last by munchor 12 years, 2 months ago
By invoking the toolchain like that, you are telling G++ that you have a full program in Game.cpp. You don't - some of the code is in Player.cpp. You can compile it using *.cpp, or by invoking the compiler like this:

$ g++ -c Game.cpp `sdl-config --cflags`
$ g++ -c Player.cpp `sdl-config --cflags`
$ g++ -o Ixlore Game.o Player.o `sdl-config --libs` -lSDL_mixer -lSDL_ttf -lSDL_image

The first two commands invoke only the compiler part of the toolchain on each source file. The last part invokes the linker on the compiled object files.

This is more of a bash script than a makefile though. As Washu hints, you should perhaps do a bit more research into makefiles.
Advertisement
Thank you, I already fixed everything =D

This topic is closed to new replies.

Advertisement