[SDL] OSX link problem
dwaliss1 at purdue.edu
Fri Jan 4 14:15:01 PST 2002
On Thu, 3 Jan 2002 jeph at mac.com wrote:
You cannot choose to run without Cocoa/ObjC unless you choose to build the
Carbon version of SDL. Getting the Carbon version to work might be painful
(see previous posts on this), and the Carbon version is generally flaky.
I'd recommend using the files SDLMain.m/.h in your project instead (from
the stationary). You can write your application in main.c; you don't have
to write any ObjC code, your code can all be C/C++.
The actual SDL implementation and startup code uses Cocoa/ObjC, which is
why we have this requirement.
>From a programming or performance standpoint, there is no disadvantage to
using Cocoa/ObjC; however, there are issues getting SDL "embedded" into
applications/interpreters that don't link to SDL directly (see previous
> I'd like to use SDL under OSX, but without Cocoa/ObjC. I can compile &
> run the project stationary just fine. But when I remove the ObjC code
> (SDLMain.h and SDLMain.m) and try to compile with just main.c, I get a
> link error: Undefined symbol: _main.
> I looked at previous threads with similar problems, and someone
> mentioned having to link to some library - libsdlmain.a, I believe.
> This library is not included with the developer download (as far as I
> can tell) and I have no idea how to find it.
> Can someone shed some light on this for me? Thanks.
> SDL mailing list
> SDL at libsdl.org
More information about the SDL