The ld message saying it couldn't find the symbol ___CFConstantStringClassReference suggests to me that you forgot to add system frameworks to your project. My guess is that adding OpenGL.framework and GLUT.framework will probably fix it for you.

That appears to be correct. Uhh... I am not sure why it is giving you grief. Try adding CoreFoundation.framework, I guess... If that doesn't work then we have something a little less obvious going wrong, such as perhaps building a 64 bit binary against a 32 bit library or maybe you added the frameworks to one target and are trying to build another, or something.

Sorry, I should have suggested CoreFoundation at first instead of OpenGL and GLUT frameworks, which have nothing to do with CoreFoundation. I don't know what I was thinking... Glad we found it anyway

(Aug 30, 2012 03:31 PM)kropcke Wrote: Just curious what led you to that conclusion.

CFConstantStringClassReference starts with the prefix "CF", which is what all the calls and type definitions in CoreFoundation have. When you get symbols not found by the linker and you don't recognize what library or framework they may be from, you can always google them and usually come up a hint that way.

Yes, CoreFoundation is a large and basic framework on Mac OS, as well as AppKit. Most applications will need use of one or both of them.

With Xcode, it depends on the project template and other things which may or may not be hidden from obvious view. I believe that if you started your GLUT project from the Cocoa app template, then in the project settings you'd find -framework Foundation and -framework AppKit under Other Linker Flags, which is another less obvious way of including those frameworks. If you started with an empty project, then I think you have to either do that yourself in the project settings, or include them under "Link Library With Libraries" (I don't recall what stuff Xcode includes automatically for you).

Whenever you find ld (the linker program) spitting out a message about a symbol not found in a .o file (an object file which has been compiled), then you can be pretty sure that you didn't tell the compiler about a library or framework, somehow, or the one you linked to doesn't contain what you expect it to contain, such as 32 or 64 bits, etc. There are other less likely ways for this to happen too, such as the library or framework is defective, like if you are making your own library and providing a header definition for a call but not actually writing the function for it. ... or maybe you included a header which does not match the compiled library.