Framework errors: ".objc_class_name_XXX", referenced from - cocoa

I have taken over a Cocoa project that includes some frameworks, and I can get no help from the previous developer. When building one of the frameworks, I get 8 errors like this:
".objc_class_name_XXX", referenced from
I have tried googling the problem, but I cant get my head around it. Any ideas?
I also get some warnings saying "missing required architecture ppc in file" for a linked framework, could this hint at the problem?
Any help will be greatly appreciated. Thank you
Søren

The missing .objc_class_name_XXX means you’re sending class messages to XXX, but not linking to the binary where XXX’s main implementation is. Presumably this is the framework that doesn’t have a PPC part.
There are three possible ways to fix this:
Get a version of the framework with a PowerPC part.
Stop building for PowerPC (the ARCHS build setting).
Stop using those classes in the PowerPC build of the project (either look them up dynamically using NSClassFromString or #ifdef them out).

Related

XCode 7 / Cordova plugin / Link issue: _utf8_nextCharSafeBody undefined symbol

I'm adapting an (apparently outdated) Cordova plugin for use in my app (PhoneRTC if you're curious).
As a Linux/CLI guy at heart I've been struggling with XCode for a day, and I managed to iron out most of the deprecated code using a lot of Google and some blind guessing. However, now I'm stuck with a final error during the linking phase:
"Undefined symbols for architechture arm64: "_utf8_nextCharSafeBody", referenced from: [snip]"
The plugin's original installation instructions mention linking the binary to the library libicucore.dylib, but this seems to have been removed in the latest XCode (there are references of the same name with .tbh extensions available but these aren't valid for that dialog - even though I can select them, but whatever).
Some more Googling offered suggestions for linking various *.frameworks instead, but to no avail - the error remains.
Does anyone have any idea what I need to link to to make this function available? Or if it's permanently removed I'd also like to know, although that would involve rebuilding the binaries which wouldn't be something I'm looking forward to...
Or if you don't know, would there be a way to grep through Apple's libraries somehow to see which one is supposed to be defining a missing symbol?
(Needless to say, IF I can get this working it's going to be forked from the original repo and donated back to the community :))
So, I'm not sure what I changed exactly, but suddenly I could add libicucore.tbh as a linked library. I probably changed the build target or something, but in any case the linking error disappeared (to be replaced by a signing error because XCode, but that I can solve).

Adding Static Library to xcode not working

I added a static Library and its header file to my OSX project and added them to Link Binary With Libraries under Build Phases.
Xcode gives me the following warning
ignoring file /Users/sd1212/Desktop/OpenGLPlugin/libClientLib.a, file was built for archive which is not the architecture being linked (x86_64)
and wont let me call any of the library methods. I thought I had an architecture problem, so I looked online... Maybe the instructions weren't clear or something, but I think that I already have the x86_64 architecture added, and I changed "Build Active Architecture only" to "No."
Here is a screen shot of the project's architecture settings
Please help! Thanks in advance
Look at the project that builds the static library, as well as the project that links to it, and make sure they both build the right architecture. Consider not only the Valid Architectures line, which you highlighted in your screen shot, but also the Architectures setting. The ones that get built are the ones in both lines.

How do I solve a "dyld: Library not loaded:" error in Xcode 4 unit tests?

I have an Xcode 4 project, a Cocoa application with Spotlight, Core Data and unit tests. The app uses a custom framework named TBPluginManager I wrote to load bundles. I originally wrote the framework in Xcode 3 but when I used it in Xcode 4 GDB kept complaining, so I recreated the framework in Xcode 4. This made GDB happy, until I tried to run the built-in unit-test and got:
[Switching to process 3840 thread 0x0]
dyld: Library not loaded: > Library/Frameworks/TBPluginManager.framework/Versions/A/TBPluginManager
Referenced from: /Users/elise/Library/Developer/Xcode/DerivedData/BookManager-cooglmktssmptpatjuetculukiqd/Build/Products/Release/BookManager.app/Contents/MacOS/BookManager
Reason: image not found
sharedlibrary apply-load-rules all
No memory available to program now: unsafe to call malloc
Now I can understand why the unit test cannot find the framework since it lives not at Library/Frameworks/TBPluginManager.framework but at /Library/Frameworks/TBPluginManager.framework. But how do I tell that to the unit-test bundle? I've tried setting the Framework, Header and Library Search path build setting, but to no avail.
BTW, I've gone back to GHUnit but I'd like to get this working as well.
FOLLOW-UP: Much as it bugs me that Grady Player got an account just to tell me that I'm an idiot, it just may be that he or she is right. My lovely, dependable framework is generating warnings and errors like they're going out of fashion and so I've turned the problem over to Apple Developer Technical Support. If anything interesting comes out of it, I'll post it here. Otherwise, I'll delete the question.
make sure that the framework installed at /Library/Frameworks/TBPluginManager.framework is valid and the same arch as you are trying to link it to. If you are in doubt recompile the framework again, put it in a custom location and set that custom location in your framework search path.

Is it possible to consolidate framework dependencies with XCode?

For example, if I created a framework that put together Ogre3D with RakNet and OIS, and I only wanted to have to distribute my framework for recompilation, is that possible?
I tried doing something like that, but I was getting linker errors. That would seem to suggest that you can't do that (and that's fine), but I want to make sure I'm not missing anything.
That's possible as long as the person doing the compiling has all those other frameworks. I'm not sure what you would want Xcode to do for you.

How do I know which OSBundleLibrary to include when using XCode?

It seems that I am doing something wrong or the linker is not very good in xcode (I imagine is the first situation :) ) but I found that I need to manually add the OSBundleLibrary references on the plist.
The problem is that sometimes I don't know which bundles should I include, for example, I am building a kernel extension and I am using VFS, it compiles but when I try to load it into the kernel it complains that it can not resolve all the VFS functions.
I usually include "com.apple.kernel.bsd" but when I check samples of VFS I can see "com.apple.kpi.bsd", a bit confusing.
Can anyone share some light?
Thanks!
I found the solution, there is a reference link with all the extensions:
http://developer.apple.com/documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptDependencies/kext_dependencies.html

Resources