LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   What is a good IDE or such that will compile SDL? (https://www.linuxquestions.org/questions/programming-9/what-is-a-good-ide-or-such-that-will-compile-sdl-298298/)

blufire 03-06-2005 09:28 AM

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.

dugas 03-06-2005 01:21 PM

use the gcc compiler

95se 03-06-2005 10:14 PM

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)

forrest44 03-07-2005 02:17 AM

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.