Is there a way to use GrowlApplicationBridge without NSClassFromString? - xcode

I'm trying to build a basic cocoa app that uses Growl.
Every time I want to use GrowlApplicationBridge I have to use something like
Class GAB = NSClassFromString(#"GrowlApplicationBridge");
[GAB performSelector:#selector(setGrowlDelegate:) withObject:self];
I would like to be able to just use
[GrowlApplicationBridge setGrowlDelegate:self];
Here's the compiler error that I get when I try the behavior that I want:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GrowlApplicationBridge", referenced from:
objc-class-ref in StatusMenuAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

As long as you're importing <Growl/Growl.h> at the top of that file and linking the framework into your app, you should be able to use [GrowlApplicationBridge setGrowlDelegate:self] just fine.
Check the top of the file and make sure you're importing it, and check your target's “Link Libraries and Frameworks” build phase and make sure you're linking it.

Related

Adding Static Library In Xcode 6

I'm using Xcode 6.0.1 and need to add a library libpt.a to my C project. I cannot figure out how to properly integrate it into my project. I have already done Link Binary With Libraries however I still continue to get this error:
Undefined symbols for architecture x86_64:
"_pt_add_xpage", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am assuming that the above error means that the library has not been integrated correctly. I have already added the header file pt.h and included into my project. What am I doing wrong?

xCode - Undefined symbols for architecture x86_64: MWPhotoBrowser

I'm trying to use the MWPhotoBrowser project in my project. I followed the whole installation process and was able to import the MWPhotoBrowser.h file. When I tried to build, I run into this error...
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_MWPhotoBrowser", referenced from:
objc-class-ref in PhotoBrowserViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Does anyone know how to resolve this?
Thanks
For anyone getting this issue...Please check if you correctly linked your project to the libMWPhotoBrowser.a file under Build Phases in your target settings !

Zxing 'undefined symbols for architecture x86-x64' error

I use zxing lib in my OS X application. I've included zxing-objc to my project and simply copy-pasted code from zxing demo (zxing-root/objc/examples/demo) to the separate ViewController class. When trying to compile project, I get the following linker errors:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_QTCaptureDevice", referenced from:
objc-class-ref in ScanViewController.o
"_OBJC_CLASS_$_ZXCapture", referenced from:
objc-class-ref in ScanViewController.o
"_QTMediaTypeMuxed", referenced from:
-[ScanViewController performVideoSourceScan] in ScanViewController.o
"_QTMediaTypeVideo", referenced from:
-[ScanViewController performVideoSourceScan] in ScanViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've carefully checked all code and compared my project properties (including c++ compiler options) to demo project properties, and everything is done right.
You need to add the necessary frameworks to your app target. You can look in the sample app for an example. Select the target in Xcode, select Build Phases, and open the Link With Libraries entry. You'll see that it includes both QuartzCore and zxing-objc-framework. It sounds like you don't have those in your project.

Undefined symbols in SenTestingKit

Just turned on unit testing on an existing project, follow all the instruction here, here will no luck.
Any hints? There are tests that work, but I was testing with a category class instead of a totally custom class.
I should also mentioned that I am using CocoPods which seems to compile fine in the test target. Oh, and I am using xcode 4.6
Here is the relevant error msg:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_UIHelpers", referenced from:
objc-class-ref in EventHashTest.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What's happening here is that your implementation (.m) for UIHelper can't be found by the UnitTest. You need to make sure your UIHelper.m is part of your app or your unit test target. See how the UIHelper.m is indicated as having target membership by the text box in the ride pane:
And, the unit test target is able to find this implementation b/c this target depends on the app target. See in the middle pane where the app is listed as a target dependency:

getting linker error even after linking the core data.framework to my project target file

I have linked the target file of my project to the coredata.framework in the Build Phases.
But still I am getting 3 linker errors like below:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CoreDataTableViewController", referenced from:
_OBJC_CLASS_$_RolesTableViewController in RolesTableViewController.o
"_OBJC_METACLASS_$_CoreDataTableViewController", referenced from:
_OBJC_METACLASS_$_RolesTableViewController in RolesTableViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am getting this problem in 2 coredata examples i was following from the tutorials. I tried to find if i missed a step. I think I am doing some small fundamental error...
Please help, what it could be...
I'm sure this is solved now, but I had the same problem. When you copy the files to your project you need to ensure you put a check next to your project under "Add to targets".

Resources