XCode confusion

· by Steve · Read in about 2 min · (297 Words)

Well, it started off well but ground to a halt pretty quickly. It’s become clear that the mechanism OSX uses to determine library loading paths is a bit different than other systems I’ve used, and/or there’s something fundamental I don’t understand about frameworks / bundles.

I can get Ogre.framework to build just fine, linking all the libraries it needs. But as soon as I try to link anything else to Ogre.framework, I get a bunch of IL linking errors. Doesn’t matter which project it is that I try to build (the SDL platform, GL rendersystem, any plugin at all), it always complains of the form “_ilGetError referenced from Ogre expected to be defined in @executable_path/../Frameworks/IL.framework/Versions/A/IL”.

In Ogre.framework, IL.framework is linked (perfectly successfully) from /Library/Frameworks, so it initially puzzled me why these plugins, which don’t link DevIL themselves anyway, complained here, and why they looked in the wrong folder. On Windows and Linux there would be no link-time dependency on IL from these builds, only a runtime dependency. I can only assume that packaging applications on OSX requires dependent frameworks to be moved into some folder local to the framework that references it, or something. Seems a bit wasteful, but I don’t know any of the theory here - another possibility is that it’s expecting Ogre.framework to already be installed in /Library/Frameworks, and that it’s folder is @exectable_path, which would lead to the right folder then. That seems a bit esoteric though and I can’t see why it would make that assumption anyway, I can’t find any settings in the project that look like it would cause that.

If any experienced XCode dev knows a good resource for reading up on the reasons for this behaviour, and the recommended way of dealing with it, please let me know.