Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ld error



On Feb 22, 2004, at 11:15 AM, Jens Frederich wrote:
Hi,

I would build a little unix application on macosx with X11-OpenGL, but I become a little error message.

gcc video.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
gcc audio.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
gcc wrapper.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
gcc media.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
gcc state.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
gcc events.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
gcc display.c -c -I/usr/local/include -I/usr/include -I/usr/X11R6/include
gcc boulderdash.c -o boulderdash -Wall -L/usr/local/lib -L/usr/X11R6/lib -lSDL -lGL -lGLU -lglut -lSDL_mixer display.o wrapper.o video.o audio.o media.o events.o state.o -I/usr/local/include -I/usr/include -I/usr/X11R6/include
boulderdash.h:40: warning: `TextureImages' defined but not used
boulderdash.h:42: warning: `SoundFiles' defined but not used
boulderdash.h:44: warning: `LevelFiles' defined but not used
ld: /usr/lib/crt1.o illegal reference to symbol: __objcInit defined in indirectly referenced dynamic library /usr/lib/libobjc.A.dylib
make: *** [boulderdash] Error 1


What is my problem, please? It's a X11 application, I don't use objective-c!
I would use the /usr/X11R6 OpenGL version, not the OpenGL Framework.

At a glance, I believe this is caused by an annoying and confusing quirk of Mach-O, of which the practical upshot is you need to link with "-lobjc" or "-framework Cocoa". One of the libraries you're using depends on the Objective-C runtime. As for the explanation of why that causes this particular error, I don't remember the theory behind it, but it's in the list archives for the Cocoa-dev list as well as this one, I believe.

-- Sailor Quasar, High Codemaster of the Web, scourge of systems
MacOS is to Windows as Terminus is to Trantor.
Email: email@hidden
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >ld error (From: Jens Frederich <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.