What is a good IDE or such that will compile SDL?
Hello. Its me again. I just started some SDL. But before I can do anything how do I compile SDL in linux. I tried to download the Dev-C++ IDE but it didnt run.
Can someone explain to me how to compile an SDL program from the command line. I use VI to write my source files. If there is a great IDE out there that would work please let me know? THankyou. |
use the gcc compiler
|
You just have to include the libraries your linking to in the command line options. For SDL this should work (basic SDL):
gcc source_code.c -lSDL -lpthread This will produce a.out of your file. If you use something like the SDL_image library, gcc source_code.c -lSDL -lSDL_image -lpthread If you are using opengl as well, then probably something like this, gcc source_code.c -lGL -lGLU -lSDL -lpthread should work. etc.. hope this helps :) (you should include the -lpthread with SDL) |
Write your source C files in any text editor
Then compile with GCC (make sure you have SDL installed): gcc source.c -o program `sdl-config --cflags --libs` of cource replace "source.c" with your source file and "program" with the name you want for the executable file produced..... Cheers Forrest. |
All times are GMT -5. The time now is 10:38 AM. |