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.
Related
New to iPhone app development, I have a problem compiling (or "Build and Run") my application after including S7FTPRequest into my class library; before I even include it in any particular script. I get the following errors:
Undefined symbols:
"_kCFStreamPropertyFTPPassword", referenced from:
_kCFStreamPropertyFTPPassword$non_lazy_ptr in S7FTPRequest.o
(maybe you meant: _kCFStreamPropertyFTPPassword$non_lazy_ptr)
"_CFWriteStreamCreateWithFTPURL", referenced from:
-[S7FTPRequest startUploadRequest] in S7FTPRequest.o
-[S7FTPRequest startCreateDirectoryRequest] in S7FTPRequest.o
"_kCFStreamPropertyFTPUserName", referenced from:
_kCFStreamPropertyFTPUserName$non_lazy_ptr in S7FTPRequest.o
(maybe you meant: _kCFStreamPropertyFTPUserName$non_lazy_ptr)
"_kCFStreamErrorDomainFTP", referenced from:
_kCFStreamErrorDomainFTP$non_lazy_ptr in S7FTPRequest.o
(maybe you meant: _kCFStreamErrorDomainFTP$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
thx!
You got it a little wrong. The problem is coming due to linking as a required framework is missing, but the framework needed is CFNetwork.framework and not libz.1.2.3.dylib
The libz dynamic library is used for zipping/unzipping operations.
Ok I kinda gave up on this solution (for the time being) but I think I solved the issue when trying something different.
It seems that many external components need some accommodating linked libraries.
You can add new libraries by going to Project > Edit Active Target "ProjectName" > General
Then you click the plus simple to see all the available libraries.
Not sure which one fixed but I added these for a different solution and voila S7FTPRequest compiled.
Here are the libraries I added (I think it was actually libz.1.2.3.dylib):
CoreGraphics.framework
CFNetwork.framework
SystemConfiguration.framework
MobileCoreServices.framework
libz.1.2.3.dylib
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
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>
I'm working with developing an application for iPhone in Objective-C
Can anyone tel me how to solve this error:
".obj_class_name_CUIFramework", referenced from:
collect2:ld returned 1 exit status
literal-pointer#_OBJC#_cls_refs#CUIFramework in MF_CoreAppDelegate.o
symbol(s) not found
I tried to compile my code, i don't have idea for what this error is related to. Please help.what could be the problem?
i've added Foundation framework and UIKit framework
Your code's well-formed, so compiles just fine. When the linker tries to link your application to the frameworks you use, it finds that you reference a framework that's not been imported to your application.
It looks like your code is using a class CUIFramework, but that you haven't added the appropriate framework to your project.
My colleague and I have been struggling with unit tests now for weeks. We have tried to get SenTest, GTM, and other frameworks set up, but we can never get past a gnarly ball of linking errors.
Here's where I am now with GTM. I would appreciate any guidance.
Beyond helping out on SO, if you have experience with this, I'd happily pay a consultant. Please email me at andrew#gaiagps.com if you think you can help me with this.
I followed the instructions here:
http://code.google.com/p/google-toolbox-for-mac/wiki/iPhoneUnitTesting. I found I also needed to add the file "GTMObjC2Runtime.h" to the project. Then, I was able to get to the point where I got the expected console output after installing the framework: "Executed 0 tests, with 0 failures (0 unexpected) in 0.030 (0.030) seconds"
Next, I went to write a test case for one of my classes. I created WebAPITest.h. I created a simple test, which worked fine. I just verified 1 == 1.
Next, I decided to write a test for my AppDelegate.h. So, I added #import "AppDelegate.h" to WebAPITest.h, and I got 8 linking errors. My project uses FBConnect, and the compiler complain that it can't find the FBConnect files. To address this, I added the the FBConnect header search path to the Test target's build config, and the linking errors went away.
Now is where I am stumped. When I try and reference AppDelegate in the implementation, I get these linking errors:
Building target “fooTest” of project “foo” with configuration “Debug” — (2 errors)
Undefined symbols:
".objc_class_name_AppDelegate", referenced from:
literal-pointer#__OBJC#__cls_refs#AppDelegate in WebAPITest.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
So, I tried adding AppDelegate to the Test target, but then it
started wanting all the dependencies for AppDelegate too, and I'm
guessing I'm not supposed to add dozens of files to the unit test
target.
Any idea what I need to do next?
Your test bundle does need access to the compiled class you are trying to test. It's your decision to accomplish that by either adding it directly to the target (and yes, with all its dependencies), by linking to a library that implements the class, or by setting up your test bundle so that it is loaded by a host application that has an implementation of the class.
This reference might be useful to you:
http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/135-Unit_Testing_Applications/unit_testing_applications.html#//apple_ref/doc/uid/TP40007959-CH20-SW3
And also from the main unit testing documentation at Apple:
http://developer.apple.com/mac/library/DOCUMENTATION/DeveloperTools/Conceptual/UnitTesting/1-Articles/CreatingTests.html#//apple_ref/doc/uid/TP40002171
Look for terms like "Test Host" and "Bundle Loader."
This stuff is not very straightforward to understand but the documentation eventually clarifies everything if you hunker down and plow through it.