[SDL] Compiling on Linux

Bill Kendrick nbs at sonic.net
Sat Jun 30 18:43:25 PDT 2007


On Sat, Jun 30, 2007 at 12:36:49AM -0500, Jonathan Greig wrote:
> what about compiling 2 or more files, is it the same with just more files?

Time to learn how to program C. :)  Use Google, buy a book, grab some
example code (e.g., existing games, tutorials, etc.)  This is getting way
off-topic from this list.

Quick summary, though:

  gcc file.c -c -o file.o `sdl-config --cflag`
  gcc file2.c -c -o file2.o `sdl-config --cflags`
  gcc file.o file2.o -o program `sdl-config --cflags --libs`

Better would be to have a Makefile and use 'make' appropriately, of course.
(O'Reilly's "Managing Projects with Make" is a good read, for example.)

-- 
-bill!
bill at newbreedsoftware.com
http://www.newbreedsoftware.com/


More information about the SDL mailing list