Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Nov 25, 2012, 12:44 AM   #1
macrumors member
Join Date: Jul 2012
Location: Canada
Library not found for -lSDLmain

I tried to compile some code, but this has shown up. I've put the SDL frameworks in both my /Library/Framework/ and ~/Library/Framework/ and compiled it manually, to no help. Any help would be awesome.

Full error report:
[Dependancies] -DMACOSX -DPIX32BGRA -arch x86_64 -framework Cocoa -framework SDL

ld: library not found for -lSDLmain
collect2: ld returned 1 exit status

Thanks in advance,
15" Macbook Pro Mid 2010, 2.53 GHz, 8 GB RAM, 254 GB SSD; 750 GB HDD 7200 RPM; 24" monitor; 1 TB External HDD
Candunc is offline   0 Reply With Quote
Old Nov 26, 2012, 12:47 PM   #2
macrumors regular
Join Date: Mar 2006
It sounds like you are converting some SDL code from Linux to Mac OS X. There are differences in how SDL is packaged on Linux and Mac OS X. The Mac version of SDL is a framework, not a library. When using the -lSDLmain flag on Mac OS X, you're going to get a link error because the Mac version of SDL does not have a library named SDLmain.

Are you using a makefile to compile the code? If so, remove the -lSDLmain linker flag. Use the -framework flag to link the SDL and Cocoa frameworks.
Mark Szymczyk
Author, Xcode Tools Sensei
szymczyk is offline   0 Reply With Quote
Old Dec 2, 2012, 12:43 PM   #3
Madd the Sane
macrumors 6502
Join Date: Nov 2010
Location: Utah
SDLmain is the utility static library that sets up the needed environment to use an SDL app. If libSDLmain.a isn't in the SDL development Disk Image, you'll have to build it from source.
Madd the Sane is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Moved iTunes library - music showing up as Shared Library vorpel Mac Basics and Help 0 Dec 9, 2013 10:55 PM
after installing mavericks, Iphoto not found and itunes library is empty ramram55 OS X Mavericks (10.9) 0 Oct 23, 2013 01:25 PM
Aperture: library across multiple drives & unified iPhoto library roland.g Digital Photography 5 Oct 13, 2013 11:41 PM
Moving iPhoto '08 library into external hard drive: library moves, photos don't dizrythmia Mac Applications and Mac App Store 13 Jan 12, 2013 10:00 PM
HomeSharing - Library not found problem. djyahtzee Apple TV and Home Theater 1 Jun 26, 2012 03:42 PM

Forum Jump

All times are GMT -5. The time now is 02:17 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2015, MacRumors.com, LLC