LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-06-2005, 09:28 AM   #1
blufire
Member
 
Registered: Jul 2004
Location: Japan
Distribution: Fedora
Posts: 148

Rep: Reputation: 16
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.
 
Old 03-06-2005, 01:21 PM   #2
dugas
Member
 
Registered: Jul 2004
Location: louisiana
Distribution: fedora 4/kubuntu
Posts: 116

Rep: Reputation: 15
use the gcc compiler
 
Old 03-06-2005, 10:14 PM   #3
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
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)

Last edited by 95se; 03-06-2005 at 10:15 PM.
 
Old 03-07-2005, 02:17 AM   #4
forrest44
Member
 
Registered: May 2004
Location: In the staple gun
Distribution: slackware4life
Posts: 119

Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot compile SDL apps godice Linux - Software 2 05-22-2005 08:34 AM
what is a good IDE for SDL (in gnome aka not kdev) poiuytrewq Programming 1 04-14-2005 04:44 AM
Looking for an IDE to program using SDL pujolasdf Linux - Software 2 04-02-2005 04:31 PM
A good IDE for C/C++ xowl Linux - Software 6 02-05-2005 05:18 PM
A good IDE sewer_monkey Linux - Software 4 06-01-2002 07:25 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration