Getting "Undefined symbols" when trying to use EventKit? - iphone

I am trying to use EventKit based around the doco & SimpleEKDemo application, however I am getting the following single error.
What does this error mean and what steps would be recommended for troubleshooting (first time I've had such a linking error & I'm a bit lost - I've parsed through my code versus teh example code and I can't see any obvious differences).
Undefined symbols:
"_OBJC_CLASS_$_EKEventStore", referenced from:
objc-class-ref-to-EKEventStore in AppointmentListController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Note that in the header file from the controller I'm using the event kit code I do have:
#import <EventKit/EventKit.h>
#import <EventKitUI/EventKitUI.h>

Check if you have added EventKit and EventKitUI frameworks to link with your target?

You might be forgot any of below things
add eventKitFramwork in Your project
Import this framework in your file #import

Related

ios: simulate touch: errors when trying private framework

I'm trying to simulate touch in iOS. There some pointers in SO suggest that I could try GraphicsServices/GSEvent.h in the private framework. However, when I followed the steps here, I got these errors:
Undefined symbols for architecture armv7:
"_GSCopyPurpleNamedPort", referenced from:
-[TestGraphicsServicesAppDelegate application:didFinishLaunchingWithOptions:] in TestGraphicsServicesAppDelegate.o
"_GSSendEvent", referenced from:
-[TestGraphicsServicesAppDelegate application:didFinishLaunchingWithOptions:] in TestGraphicsServicesAppDelegate.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any suggestion? Thanks
edit:
the code I used is from Using GraphicsServices.h/GSEvent as well as compiling CLI iPhone tools with Xcode.
Looks like the errors are from this line.
mach_port_t thePortOfApp = GSCopyPurpleNamedPort...
GSSendEvent(&record, thePortOfApp);
OK, I think I made some mistakes when I added the framework.
Somehow I got my project working now.
The errors have gone away after I did a couple things.
In Build Setting, I changed Always Search User Paths to Yes.
Added the path to the private header in User Header Search Paths.
Also, in Build Phrases tab, I add the GraphicsServices in the Link Binary with Libraries section.
Now I can do simple stuff like GSEventLockDevice() and simulating pressing home button.
Still have no clue about touch.

How to use 2 Reachability class's together in one project?

I'm trying to check the network reachability with the following code found here on stackoverflow. The only problem is that I already have the reachability classes in my project due to using the ASIHTTPRequest classes. I'm unable to get my project to build by using Apple's default Reachability code due to the following errors:
"_kReachabilityChangedNotification", referenced from:
_kReachabilityChangedNotification$non_lazy_ptr in ASIHTTPRequest.o
(maybe you meant: _kReachabilityChangedNotification$non_lazy_ptr)
(maybe you meant: _kReachabilityChangedNotification$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
I guess my question is how can I get this code here work with the ASIHTTPRequest's Reachability class? Thanks.
The 'Reachability' class used by ASIHTTPRequest's classes are the same as apple's Reachability class. You are getting this error because you might have
1) Forgot to add 'MobileCoreServices.framework'
2) or 'CFNetwork.framework'
3) and last but not the least 'libz.1.2.3.dylib' library.
Let me know if this helps.
Better to resturcture to make both the project and ASIHTTPRequest lib depends upon reachability to avoid the duplication.
Anyway the quick the dirty way is just to rename reachability class in either place.

LayarPlayer - LPAugmentedRealityViewController build problem on iphone

I´m trying to get the LayarPlayer SDK to work but i im stuck. I´ll keep getting this warning no matter what i do. I have followed there "guide" but it doesnt help. Anyone here who can help?
"_OBJC_CLASS_$_LPAugmentedRealityViewController", referenced from:
objc-class-ref-to-LPAugmentedRealityViewController in FirstViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Seems to me you need to link to the binary library. In Xcode go "Groups & Files" (left panel in the default layout). Then right click on Add Existing Frameworks->Add Other ... locate and select liblayarplayer.a in the "Release" directory.
It seems that you have not accurately added their library, or you might not be importing the appropriate files accordingly using #import.
Please post the code of your FirstViewContoller.m

_OBJC_CLASS_$_ - symbol(s) not found error

I create a new application for iPad starting from an UISplitView application that works correctly, in the new application I get this error:
"_OBJC_CLASS_$_ConcertListController", referenced from:
objc-class-ref-to-ConcertListController in RootViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
What it mean? How can I solve?
Apparently you need to link in whatever framework ConcertListController is a part of. Try going to the project window, right click on frameworks and choose add existing framework .... you should be able to find the framework including ConcertListController there.
I also had a similar problem. My solution was remove the reference and re added those files. Then it will show a window and make sure to tick on "Add to target" check box.

How to create mobile substrate plugins on XCode?

I just wanna create a MS plugin to hook SpringBoard. I'm following "gojohnnyboi" tutorial from here "http://www.ipodtouchfans.com/forums/showthread.php?t=103558".
To create a dylib on XCode, I'm following "SkylarEC" tutorial. I mix these two great tutorials and finally got succeed by getting a dylib. But when I placed the dylib in the /Library/MobileSubstrate/DynamicLibraries/ nothing is happened (no alert was shown).
By evaluating, I found that, this dylib doesn't have any starting point when it was loaded into the memory. So I mentioned a starting point by declaring a constructor in the .mm file like,
__ attribute__((constructor)) static void init()
{
Class _$SBAppIcon = objc_getClass("SBApplicationIcon");
MSHookMessage(_$SBAppIcon, #selector(launch), (IMP) &__$ExampleHook_AppIcon_Launch, "__OriginalMethodPrefix_");
}
But when I'm trying to compile this, I'm getting an error like,
**Undefined symbols:
"_MSHookMessage", referenced from:
init() in ExampleHook.o
ld: symbol(s) not found
collect2: ld returned 1 exit status.**
Does anyone has idea how to solve this? It would be great and more helpful if anyone share the detailed tutorial/instructions to create a dylib on XCode.
P.S I placed all the libsubstrate.dylib and substrate.h files in the corresponding location. And the locations are,
libsubstrate.dylib : /Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/
substrate.h : /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include
and my base SDK is 3.0.
You should probably check out iOSOpenDev
(These are very old tutorials. Some modern MS code can be found in http://iphonedevwiki.net/index.php/MobileSubstrate. Eventually someone needs to write an updated tutorial...)
Make sure you have added libsubstrate.dylib in your Xcode project (Add → Existing files...). The compiler will not automatically find which dylib to link unless you tell it so.
Try http://unlimapps.com/?p=15 it will be much easier to compile plugins using the methods in that post
You have to copy CydiaSubstrate.framework to /Library/Frameworks in your mac and link to CydiaSubstrate
#include <CydiaSubstrate/CydiaSubstrate.h>