12 Linking Errors

255 views
Skip to first unread message

Brady White

unread,
Apr 2, 2010, 7:49:54 PM4/2/10
to Google Data APIs Objective-C Client Library Discussion
I'm just getting set up with the GData Objective-C Client library and
haven't been able to build yet in an iPhone application. I've
followed all the instructions on the "Building the Library" wiki page
under the "Compiling the Source Files Directly into a Mac or iPhone
Application" heading. I have copied the "Gdata Sources" folder as a
reference into the project and removed all but "Docs" and "Common"
folders.

Any tips?


Building target “MyProject” of project “MyProject” with configuration
“Release” — (12 errors)
cd /Users/Brady/XCode/NoteSync
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/
Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/
gcc-4.2 -arch i386 -isysroot /Developer/Platforms/
iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.2.sdk -L/
Users/Brady/XCode/NoteSync/build/Release-iphonesimulator -F/Users/
Brady/XCode/NoteSync/build/Release-iphonesimulator -filelist /Users/
Brady/XCode/NoteSync/build/NoteSync.build/Release-iphonesimulator/
NoteSync.build/Objects-normal/i386/NoteSync.LinkFileList -mmacosx-
version-min=10.5 -lxml2 -framework Foundation -framework UIKit -
framework CoreGraphics -o /Users/Brady/XCode/NoteSync/build/Release-
iphonesimulator/NoteSync.app/NoteSync
Undefined symbols:
"_kSecClass", referenced from:
_kSecClass$non_lazy_ptr in GDataOAuthViewControllerTouch.o
"_kSecAttrAccount", referenced from:
_kSecAttrAccount$non_lazy_ptr in GDataOAuthViewControllerTouch.o
"_SecItemAdd", referenced from:
-[GDataOAuthKeychain setPassword:forService:account:error:] in
GDataOAuthViewControllerTouch.o
"_kSecMatchLimit", referenced from:
_kSecMatchLimit$non_lazy_ptr in GDataOAuthViewControllerTouch.o
"_kSecClassGenericPassword", referenced from:
_kSecClassGenericPassword$non_lazy_ptr in
GDataOAuthViewControllerTouch.o
"_kSecAttrGeneric", referenced from:
_kSecAttrGeneric$non_lazy_ptr in GDataOAuthViewControllerTouch.o
"_SecItemDelete", referenced from:
-[GDataOAuthKeychain removePasswordForService:account:error:] in
GDataOAuthViewControllerTouch.o
"_kSecReturnData", referenced from:
_kSecReturnData$non_lazy_ptr in GDataOAuthViewControllerTouch.o
"_kSecValueData", referenced from:
_kSecValueData$non_lazy_ptr in GDataOAuthViewControllerTouch.o
"_kSecAttrService", referenced from:
_kSecAttrService$non_lazy_ptr in GDataOAuthViewControllerTouch.o
"_kSecMatchLimitOne", referenced from:
_kSecMatchLimitOne$non_lazy_ptr in
GDataOAuthViewControllerTouch.o
"_SecItemCopyMatching", referenced from:
-[GDataOAuthKeychain passwordForService:account:error:] in
GDataOAuthViewControllerTouch.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Greg Robbins

unread,
Apr 2, 2010, 9:11:04 PM4/2/10
to gdata-objec...@googlegroups.com
Either link against Security.framework, or (better) remove the OAuth files from the Common/Optional source group, or (best) define in the project containing the GData source files the compiler variable GDATA_REQUIRE_SERVICE_INCLUDES and the specific service GDATA_INCLUDE_DOCS_SERVICE you need for your project, as mentioned on the BuildingTheLibrary wiki page.

Matt

unread,
Apr 25, 2010, 12:14:41 AM4/25/10
to Google Data APIs Objective-C Client Library Discussion
I'm having a similar set of errors, no matter how many times I tweak
the compile settings or start from scratch.
--
You received this message because you are subscribed to the Google Groups "Google Data APIs Objective-C Client Library Discussion" group.
To post to this group, send email to gdata-objec...@googlegroups.com.
To unsubscribe from this group, send email to gdata-objectivec-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gdata-objectivec-client?hl=en.

Brady White

unread,
Apr 26, 2010, 9:26:16 AM4/26/10
to Google Data APIs Objective-C Client Library Discussion
Greg,

Just to let you know, I had to delete the OAuth files because I could
never get the (best) option to work (after about 8 hrs of trying from
following the wiki page. Perhaps you could put in a few more details
into that wiki page, it would save others hours of time as well).

Greg Robbins

unread,
Apr 26, 2010, 2:53:34 PM4/26/10
to gdata-objec...@googlegroups.com
The OAuth-related files all start with

#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_OAUTH

so the code in them will be completely compiled out so long as your target is built with

  -DGDATA_REQUIRE_SERVICE_INCLUDES=1

in the "Other C Flags" build settings.  This is mentioned in BuildingTheLibrary wiki page, under "Removing Unneeded Code"

iPhoneApp

unread,
Apr 27, 2010, 5:13:03 PM4/27/10
to Google Data APIs Objective-C Client Library Discussion
Hi, did you find the solution???? I am also getting such errors even
after setting -DGDATA_REQUIRE_SERVICE_INCLUDES=1

Thanks

Ash Kin

unread,
Apr 27, 2010, 11:30:45 PM4/27/10
to Google Data APIs Objective-C Client Library Discussion
Hi, All,

I have also done the same setting but still getting following error
message.

Undefined symbols:
".objc_class_name_GDataOAuthViewControllerTouch", referenced from:
literal-pointer@__OBJC@__cls_refs@GDataOAuthViewControllerTouch
in SomeViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Thanks,
Ash

Leonardo Lobato

unread,
Apr 28, 2010, 7:37:40 AM4/28/10
to Google Data APIs Objective-C Client Library Discussion
It only worked for me after I added the following flags to "Other C
Flags":

-DGDATA_REQUIRE_SERVICE_INCLUDES=1
-DGDATA_INCLUDE_DOCS_SERVICE=1

..to both my host project AND GData.xcodeproj target settings.

Also, don't forget to edit the conf you're actually using (Debug,
Release or both).

Ash Kin

unread,
Apr 28, 2010, 8:32:41 AM4/28/10
to gdata-objec...@googlegroups.com

Hi,

 

I am able successfully add new G-Data static library with all required settings to use Health and Calendar service. All the setting are same in both projects and also set Other C Flags.

 

My application also works fine but when I try to use OAuth classes getting following error. I am able to import the class GDataOAuthViewControllerTouch but when I try to create any object on that class….

 

Undefined symbols:

 ".objc_class_name_GDataOAuthViewControllerTouch", referenced from:

     literal-pointer@__OBJC@__cls_refs@GDataOAuthViewControllerTouch

in SomeViewController.o

 

ld: symbol(s) not found

collect2: ld returned 1 exit status


Thanks,
Ash

Greg Robbins

unread,
Apr 28, 2010, 10:36:33 AM4/28/10
to gdata-objec...@googlegroups.com
To use the OAuth classes for signing in, your project should explicitly include the OAuth code with the C flag

  -DGDATA_INCLUDE_OAUTH=1

iPhoneApp

unread,
Apr 28, 2010, 3:06:45 PM4/28/10
to Google Data APIs Objective-C Client Library Discussion
Thanks Greg. The other thing is finishedWithAuth function is not
getting called

- (void)viewController:(GDataOAuthViewControllerTouch *)viewController
finishedWithAuth:(GDataOAuthAuthentication *)auth
error:(NSError *)error {

Also, i am not getting the token value the way it returns in
OAuthSample application.

Any help is appreciated

Thank you

Greg Robbins

unread,
Apr 28, 2010, 3:27:36 PM4/28/10
to gdata-objec...@googlegroups.com
Does the OAuthSampleTouch app work for you?

iPhoneApp

unread,
Apr 28, 2010, 3:49:19 PM4/28/10
to Google Data APIs Objective-C Client Library Discussion
Well, i try to debug it and found the same thing - not getting the
token value. It goes back to OAuthSampleRootViewControllerTouch view
when i click on "Grant Access" button but token value stays NULL.

Also, finishedWithAuth function never gets called.

Thank you

Greg Robbins

unread,
Apr 28, 2010, 4:14:13 PM4/28/10
to gdata-objec...@googlegroups.com
When I run OAuthSampleTouch in the 3.0 simulator and set a breakpoint on OAuthSampleRootViewControllerTouch's viewController:finishedWithAuth:error: method, the breakpoint is hit when the window is dismissed. You should be able to reproduce that. I cannot tell from your message what is different about your configuration, or what you are trying to do.

Also, please start a new group discussion thread with a new topic such as this; do not reply with a new question to a previous thread.
Reply all
Reply to author
Forward
0 new messages