iDevGames Forums
Linker Probs in PB - GLUT - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Linker Probs in PB - GLUT (/thread-7087.html)



Linker Probs in PB - GLUT - seedjar - May 11, 2003 06:26 PM

So I wrote a little GLUT program to play with the accumulation buffer, but I get a strange error when the linker kicks in:

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

This error only occurs when the GLUT library is checked for compiling, so I believe that's the problem. Of course, when it's not included, I get undefined symbol errors for the GLUT calls.
I've seen errors like this before when I mess up function overloading and such, but I don't know how to get in there are correct references for these files. The Apple documentation seems to deny the existance of the usr directory altogether so I can't find any info on what these files do or where I can find replacements.
Apple Care won't tell me anything without $50 - I'm a student so I really can't afford that without an assurance that they can help. I have a feeling I just have to replace a few files or something, and I don't think that's worth the money.
If anybody can help me, I'd be eternally grateful.

Thanks
~Joe Granville


Linker Probs in PB - GLUT - OneSadCookie - May 11, 2003 06:34 PM

This is the second most frequently asked question on these boards and on Apple's mailing lists. If you'd searched, I'm sure you could have found the answer.

Do one of the following:
  • link with Foundation.framework
  • link with Cocoa.framework
  • add [font=monaco,courier]-lobjc[/font] to your target's extra linker flags



Linker Probs in PB - GLUT - seedjar - May 11, 2003 07:04 PM

That did it. Thanks a lot.
~Joe Granville