Compiling GData for iPhone - iphone

I'm trying to compile a project that uses the GData objective-c framework. I've successfully compiled and run the project under the 'Debug' configuration, but when I try to compile using 'Release' and now 'Adhoc' I get the following errors. NOTE: I duplicated the debug configuration for adhoc and that doesn't seem to help.
"_kGDataGoogleAnalyticsDefaultAccountFeed", referenced from:
_kGDataGoogleAnalyticsDefaultAccountFeed$non_lazy_ptr in TKGoogleAnayliticsAPI.o ".objc_class_name_GDataFeedAnalyticsAccount",
referenced from:
literal-pointer#__OBJC#__cls_refs#GDataFeedAnalyticsAccount in
TKGoogleAnayliticsAPI.o ".objc_class_name_GDataFeedAnalyticsData",
referenced from:
literal-pointer#__OBJC#__cls_refs#GDataFeedAnalyticsData in
TKGoogleAnayliticsAPI.o ".objc_class_name_GDataQueryAnalytics",
referenced from: literal-pointer#__OBJC#__cls_refs#GDataQueryAnalytics
in TKGoogleAnayliticsAPI.o
".objc_class_name_GDataServiceGoogleAnalytics", referenced from:
literal-pointer#__OBJC#__cls_refs#GDataServiceGoogleAnalytics in
TKGoogleAnayliticsAPI.o ld: symbol(s) not found collect2: ld returned
1 exit status

This looks like you missed linking the GData library in your "Release" configuration. When you added it, did you by chance make sure you had "All Configurations" selected or just "Debug"?

try adding security framework and clean build

Related

How to troubleshoot "Undefined symbols for architecture i386"

I'm trying to run an Xcode project developed by someone else and I keep getting the following error. Googling it suggests that I'm missing some dependency but if so I don't know which one. Supposedly the project already has all "Link Binary With Libraries" configured. I've tried different versions of Xcode and target devices and I get the same error. How can I narrow the problem down further?
Undefined symbols for architecture i386:
"___gl_pqSortExtractMin", referenced from:
___gl_computeInterior in sweep.o
"___gl_pqSortMinimum", referenced from:
___gl_computeInterior in sweep.o
"___gl_pqSortNewPriorityQ", referenced from:
_InitPriorityQ in sweep.o
"___gl_pqSortInsert", referenced from:
_InitPriorityQ in sweep.o
_CheckForIntersect in sweep.o
"___gl_pqSortInit", referenced from:
_InitPriorityQ in sweep.o
"___gl_pqSortDeletePriorityQ", referenced from:
_InitPriorityQ in sweep.o
_DonePriorityQ in sweep.o
_CheckForIntersect in sweep.o
"___gl_pqSortDelete", referenced from:
_CheckForRightSplice in sweep.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
That means that even if the compiler has the header file, when it actually linked them, it didn't find the real implementation of this code. So maybe you didn't linked your static library (only included the header file), or this static library hasn't been compiled for i386 architecture. So you can't make it work on simulator. You should check with lipo -info libMylib.a on what kind of architecture it has been compiled (armv6 - armv7 - armv7s, or whatever else)
Ok here what i have found:
This is the sweep file you are using.
http://oss.sgi.com/cgi-bin/cvsweb.cgi/projects/ogl-sample/main/gfx/lib/glu/libtess/sweep.c?annotate=1.2
Inside
static int CheckForRightSplice( GLUtesselator *tess, ActiveRegion *regUp )
there is
pqDelete( tess->pq, eUp->Org->pqHandle ); /* __gl_pqSortDelete */
By the way into the include file in sweep there is:
#include "priorityq.h"
So it let you compile because you have the header definition of the function, but you don't have the binary implementation. So you get linker error.
I dunno if you need to instal openGl in your mac ( i though it was already included), by the way i'm sure you don't have the (opengl/glu/libtess) libtess library, this is where there is the "priority.h" definition.
Here is the glu lib if found:
http://svn.netlabs.org/repos/gl2/opengl/glu/libtess/
So you should ask your friend if he has compiled himself the framework or not. Maybe you forget to add some link into your Xcode project, or the binary is missing from your mac, or not compiled into the i386 (even if i doubt of this). By the way i'm really not an openGl expert, but if you ask anyone into an openGl forum, they surely can help you.

Adding Reachability class fails when I am trying to build

I have added the SystemConfiguration framework. I am deploying against targets from 3.2 and higher. Have I forgotten to add something?
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Reachability", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Okay, the clues are all in the error report you have posted.
While linking (the message is from the linker ld) which occurs after compilation of all the symbols across your project, the message is saying
"In AppDelegate, you have referenced a class object called Reachability"
"_OBJC_CLASS_$_Reachability"
and as far as the linker is concerned Reachability is undefined.
So, check that Reachability is being compiled in your project. The are a couple of ways to do this. Perhaps the most clear way is to
1 select the project file in the navigation pane
2 select the target
3 select Build Phases
4 Expand the Compile Sources section
*Now check the list of sources that will be compiled for your missing class, in your case Reachability.m
If it is missing, use the + button to add the file to the target.
Another way is to
1 select the file you think is not being compiled
2 open the utilities panel
3 select the file inspector tab
There will be a checkbox for each target in your project and you can easily see if your .m file is being compiled for each/all targets or not.
You might have forgotten to include the Reachability classes in your project!
I had a similar problem when I upgraded to the newest version of Mixpanel. The error read:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:
objc-class-ref in Mixpanel.o
You can follow Damo's solution until the last step, and then instead of expanding the Compile Sources section, you have to expand the Link Binary With Libraries section instead, and add the CoreTelephony.framework source which contains CTTelephonyNetworkInfo.
You can read more about the CTTelephonyNetworkInfo class reference on Apple's official website here: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Reference/CTTelephonyNetworkInfo/Reference/Reference.html

How do I link the libSCFoundationCMSApp.a & libPMAnalytics-r69.a libs and fix this error

I am taking over a really old iPhone project. I am getting these errors when I compile. Do I have libSCFoundationCMSApp.a & libPMAnalytics-r69.a in the wrong locations or am I just missing the libs that the app needs to properly use them?
".objc_class_name_NSNull", referenced from:
literal-pointer#__OBJC#__cls_refs#NSNull in libSCFoundationCMSApp.a(NSDictionaryAdditions.o)
literal-pointer#__OBJC#__cls_refs#NSNull in libSCFoundationCMSApp.a(XMLAdditions.o)
literal-pointer#__OBJC#__cls_refs#NSNull in libSCFoundationCMSApp.a(FMDatabase.o)
literal-pointer#__OBJC#__cls_refs#NSNull in libPMAnalytics-r69.a(Beacon.o)
literal-pointer#__OBJC#__cls_refs#NSNull in libPMAnalytics-r69.a(PMJSONUtils.o)
literal-pointer#__OBJC#__cls_refs#NSNull in libPMAnalytics-r69.a(PMFBXMLHandler.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
It sounds to me more likely that those libraries aren't linked properly to Foundation.framework.
Its complaining that it can't find the NSNull class name as a symbol and that it was referenced from within those libraries.

Reference library cyberlink

I reference the CyberLink library inside another target in an iPhone project.
But I have some bugs while compiling when I implemented a CyberLink class.
those kind of errors :
Undefined symbols:
"_xmlParseDocument", referenced from:
_cg_libxml2_parsewrapper in libCyberLink.a(cxml_parser_libxml2.o)
"_xmlGetPredefinedEntity", referenced from:
_cg_libxml2_get_entity in libCyberLink.a(cxml_parser_libxml2.o)
"_xmlCreateMemoryParserCtxt", referenced from:
_cg_libxml2_parsewrapper in libCyberLink.a(cxml_parser_libxml2.o)
"_xmlFreeParserCtxt", referenced from:
_cg_libxml2_parsewrapper in libCyberLink.a(cxml_parser_libxml2.o)
"_xmlFreeDoc", referenced from:
_cg_libxml2_parsewrapper in libCyberLink.a(cxml_parser_libxml2.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
If somebody can help me, it would be nice =)
You have to add -lxml2 in the "other linker flags" properties of the build tab in the info of your target.

Xcode CGRectZero Error

I am getting the following error when compiling my code
"_CGRectZero", referenced from:
_CGRectZero$non_lazy_ptr in RootViewController.o
_CGRectZero$non_lazy_ptr in SecondViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (1 error)
could someone tell me a solution to solve this?
Sounds like your project is missing a framework.
Right-click on the Frameworks folder in your project's Groups & Files column, then select Add > Existing Frameworks...
Choose CoreGraphics.framework from the frameworks list.
Once you rebuild, this error should go away (unless it is something else).