The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Re: using SDL with OSX C++
Christian Walther
Guest

Olivier Delannoy wrote:
Quote:
SDL is written in C not objective C.

Some of the Mac specific parts are in Objective C (Cocoa).

Chris Ball wrote:
Quote:
I'm trying to put SDL into an OSX C++ (carbon) project.
The problem is that SDL seems to be written in objective-C,
and when I compile it gives me:

ld: /usr/lib/crt1.o illegal reference to symbol:
__objcInit defined in indirectly referenced dynamic library
/usr/lib/libobjc.A.dylib

Does anyone know how to glue my C++ project to SDL?

I've never used SDL with C++, and I actually know very little about C++,
but anyway: You need to link your application with the Cocoa
framework, are you doing that? "-framework Cocoa" on the command line,
or add the Cocoa framework to the project in Xcode.

-Christian
Re: using SDL with OSX C++
Richard Schreyer
Guest

You probably need to add '-lobjc' to your CFLAGS, to link in the ObjC
lib.

Richard Schreyer

On Jan 13, 2006, at 8:14 AM, Christian Walther wrote:

Quote:
Olivier Delannoy wrote:
Quote:
SDL is written in C not objective C.

Some of the Mac specific parts are in Objective C (Cocoa).

Chris Ball wrote:
Quote:
I'm trying to put SDL into an OSX C++ (carbon) project.
The problem is that SDL seems to be written in objective-C,
and when I compile it gives me:
ld: /usr/lib/crt1.o illegal reference to symbol:
__objcInit defined in indirectly referenced dynamic library /usr/
lib/libobjc.A.dylib
Does anyone know how to glue my C++ project to SDL?

I've never used SDL with C++, and I actually know very little about
C++, but anyway: You need to link your application with the Cocoa
framework, are you doing that? "-framework Cocoa" on the command
line, or add the Cocoa framework to the project in Xcode.

-Christian


_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Re: using SDL with OSX C++
Chris Ball
Guest

Thanks you guys
Re: using SDL with OSX C++
Ryan C. Gordon
Guest

Quote:
You probably need to add '-lobjc' to your CFLAGS, to link in the ObjC
lib.

Use "-framework Cocoa" ... don't link with the Objective C runtime directly.

--ryan.