Author Topic: SDL Setup on Mac OS  (Read 10125 times)

Offline codeblue

  • Single posting newcomer
  • *
  • Posts: 3
SDL Setup on Mac OS
« on: December 04, 2008, 01:40:48 am »
I've installed CodeBlocks and SDL on a Mac. I created an sdl project using the codeblocks template and I get the the following message after trying to build and run the template:

-------------- Build: Debug in Test01 ---------------
Linking console executable: bin/Debug/Test01
ld: library not found for -lSDLmain
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
I've spent a couple of hours on the web trying to find a solution but most of what I find is either for windows or for mac xcode.

JCR.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: SDL Setup on Mac OS
« Reply #1 on: December 07, 2008, 11:36:39 pm »
If you install SDL as libraries (with ./configure && make && sudo make install), you get the libSDLmain.a library. If you install SDL as frameworks (disk image), you only get the "SDLMain.m" source code and need to build the library from it yourself...

Code
gcc -I/Library/Frameworks/SDL.framework/Headers -c SDLMain.m
ar rcs libSDLmain.a SDLMain.o

This is (cryptically) documented in SDL/devel-lite/ReadMeDevLite.txt
« Last Edit: December 07, 2008, 11:39:40 pm by afb »

Offline slanker70

  • Single posting newcomer
  • *
  • Posts: 6
Re: SDL Setup on Mac OS
« Reply #2 on: April 26, 2009, 07:56:25 pm »
Hi,

I'm also currently trying to setup codeblocks with SDL in Mac. Can you please explain to me if you've managed to set it up or point me to a tutorial.

Regards,

Perdana Putra