Undefined symbols: "_OBJC_CLASS_$_GDataServiceGoogleDocs", referenced from:

85 views
Skip to first unread message

Chris

unread,
Nov 30, 2010, 5:55:04 PM11/30/10
to Google Data APIs Objective-C Client Library Discussion
I am trying to build a small Cocoa application for MAC OS X which uses
Google Docs API via the GData.framework

I have followed the link 'Building the Library'
http://code.google.com/p/gdata-objectivec-client/wiki/BuildingTheLibrary

and I linked the GData.framework in my project as described in the
document.

The project is a brand new Cocoa application, with only one class that
in my one and only Action has this one line:

GDataServiceGoogleDocs *service = [[GDataServiceGoogleDocs alloc]
init];

BUT

When I compile I get this error:

Undefined symbols:
"_OBJC_CLASS_$_GDataServiceGoogleDocs", referenced from:
objc-class-ref-to-GDataServiceGoogleDocs in MainMenuController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

It seems that, although the headers are accessible to XCode, the
linking does not succeed.

Is there anyone that can give me a step by step example on how to do
this?
I have compiled the examples and they work fine, and I have tried
copying the structure of the project with the same Build Phases and
all... without any luck!


I would really appreciate any help.

Tnx,
Chris


PS. The full build output is listed below:


Build TestProj of project TestProj with configuration Debug

ProcessInfoPlistFile /Users/Chris/Desktop/TestProj/build/Debug/
TestProj.app/Contents/Info.plist TestProj-Info.plist
cd /Users/Chris/Desktop/TestProj
builtin-infoPlistUtility TestProj-Info.plist -genpkginfo /Users/Chris/
Desktop/TestProj/build/Debug/TestProj.app/Contents/PkgInfo -
expandbuildsettings -platform macosx -o /Users/Chris/Desktop/TestProj/
build/Debug/TestProj.app/Contents/Info.plist

CopyStringsFile /Users/Chris/Desktop/TestProj/build/Debug/TestProj.app/
Contents/Resources/English.lproj/InfoPlist.strings English.lproj/
InfoPlist.strings
cd /Users/Chris/Desktop/TestProj
setenv ICONV /usr/bin/iconv
/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/
Resources/copystrings --validate --inputencoding utf-8 --
outputencoding UTF-16 English.lproj/InfoPlist.strings --outdir /Users/
Chris/Desktop/TestProj/build/Debug/TestProj.app/Contents/Resources/
English.lproj

CompileXIB /Users/Chris/Desktop/TestProj/English.lproj/MainMenu.xib
cd /Users/Chris/Desktop/TestProj
/Developer/usr/bin/ibtool --errors --warnings --notices --output-
format human-readable-text --compile /Users/Chris/Desktop/TestProj/
build/Debug/TestProj.app/Contents/Resources/English.lproj/
MainMenu.nib /Users/Chris/Desktop/TestProj/English.lproj/MainMenu.xib
--sdk /Developer/SDKs/MacOSX10.6.sdk

ProcessPCH /var/folders/nI/nIEOBKrOFb4M2Ggj7b0Ae++++TI/-Caches-/
com.apple.Xcode.501/SharedPrecompiledHeaders/TestProj_Prefix-
fijkwwwlohyljhfhtolutjeyyuko/TestProj_Prefix.pch.gch
TestProj_Prefix.pch normal x86_64 objective-c com.apple.compilers.gcc.
4_2
cd /Users/Chris/Desktop/TestProj
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x objective-c-header -arch x86_64 -
fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-
blocks -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/
MacOSX10.6.sdk -mfix-and-continue -mmacosx-version-min=10.6 -gdwarf-2 -
iquote /Users/Chris/Desktop/TestProj/build/TestProj.build/Debug/
TestProj.build/TestProj-generated-files.hmap -I/Users/Chris/Desktop/
TestProj/build/TestProj.build/Debug/TestProj.build/TestProj-own-target-
headers.hmap -I/Users/Chris/Desktop/TestProj/build/TestProj.build/
Debug/TestProj.build/TestProj-all-target-headers.hmap -iquote /Users/
Chris/Desktop/TestProj/build/TestProj.build/Debug/TestProj.build/
TestProj-project-headers.hmap -F/Users/Chris/Desktop/TestProj/build/
Debug -F/Users/Chris/Desktop/TestProj/../../Downloads/gdata-objectivec-
client-1.10.0/Source/build/Debug -I/Users/Chris/Desktop/TestProj/build/
Debug/include -I/Users/Chris/Desktop/TestProj/build/TestProj.build/
Debug/TestProj.build/DerivedSources/x86_64 -I/Users/Chris/Desktop/
TestProj/build/TestProj.build/Debug/TestProj.build/DerivedSources -
DDEBUG=1 -c /Users/Chris/Desktop/TestProj/TestProj_Prefix.pch -o /var/
folders/nI/nIEOBKrOFb4M2Ggj7b0Ae++++TI/-Caches-/com.apple.Xcode.501/
SharedPrecompiledHeaders/TestProj_Prefix-fijkwwwlohyljhfhtolutjeyyuko/
TestProj_Prefix.pch.gch

CompileC build/TestProj.build/Debug/TestProj.build/Objects-normal/
x86_64/main.o /Users/Chris/Desktop/TestProj/main.m normal x86_64
objective-c com.apple.compilers.gcc.4_2
cd /Users/Chris/Desktop/TestProj
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x objective-c -arch x86_64 -fmessage-
length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -
O0 -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/
MacOSX10.6.sdk -mfix-and-continue -mmacosx-version-min=10.6 -gdwarf-2 -
iquote /Users/Chris/Desktop/TestProj/build/TestProj.build/Debug/
TestProj.build/TestProj-generated-files.hmap -I/Users/Chris/Desktop/
TestProj/build/TestProj.build/Debug/TestProj.build/TestProj-own-target-
headers.hmap -I/Users/Chris/Desktop/TestProj/build/TestProj.build/
Debug/TestProj.build/TestProj-all-target-headers.hmap -iquote /Users/
Chris/Desktop/TestProj/build/TestProj.build/Debug/TestProj.build/
TestProj-project-headers.hmap -F/Users/Chris/Desktop/TestProj/build/
Debug -F/Users/Chris/Desktop/TestProj/../../Downloads/gdata-objectivec-
client-1.10.0/Source/build/Debug -I/Users/Chris/Desktop/TestProj/build/
Debug/include -I/Users/Chris/Desktop/TestProj/build/TestProj.build/
Debug/TestProj.build/DerivedSources/x86_64 -I/Users/Chris/Desktop/
TestProj/build/TestProj.build/Debug/TestProj.build/DerivedSources -
DDEBUG=1 -include /var/folders/nI/nIEOBKrOFb4M2Ggj7b0Ae++++TI/-Caches-/
com.apple.Xcode.501/SharedPrecompiledHeaders/TestProj_Prefix-
fijkwwwlohyljhfhtolutjeyyuko/TestProj_Prefix.pch -c /Users/Chris/
Desktop/TestProj/main.m -o /Users/Chris/Desktop/TestProj/build/
TestProj.build/Debug/TestProj.build/Objects-normal/x86_64/main.o

CompileC build/TestProj.build/Debug/TestProj.build/Objects-normal/
x86_64/TestProjAppDelegate.o /Users/Chris/Desktop/TestProj/
TestProjAppDelegate.m normal x86_64 objective-c
com.apple.compilers.gcc.4_2
cd /Users/Chris/Desktop/TestProj
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x objective-c -arch x86_64 -fmessage-
length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -
O0 -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/
MacOSX10.6.sdk -mfix-and-continue -mmacosx-version-min=10.6 -gdwarf-2 -
iquote /Users/Chris/Desktop/TestProj/build/TestProj.build/Debug/
TestProj.build/TestProj-generated-files.hmap -I/Users/Chris/Desktop/
TestProj/build/TestProj.build/Debug/TestProj.build/TestProj-own-target-
headers.hmap -I/Users/Chris/Desktop/TestProj/build/TestProj.build/
Debug/TestProj.build/TestProj-all-target-headers.hmap -iquote /Users/
Chris/Desktop/TestProj/build/TestProj.build/Debug/TestProj.build/
TestProj-project-headers.hmap -F/Users/Chris/Desktop/TestProj/build/
Debug -F/Users/Chris/Desktop/TestProj/../../Downloads/gdata-objectivec-
client-1.10.0/Source/build/Debug -I/Users/Chris/Desktop/TestProj/build/
Debug/include -I/Users/Chris/Desktop/TestProj/build/TestProj.build/
Debug/TestProj.build/DerivedSources/x86_64 -I/Users/Chris/Desktop/
TestProj/build/TestProj.build/Debug/TestProj.build/DerivedSources -
DDEBUG=1 -include /var/folders/nI/nIEOBKrOFb4M2Ggj7b0Ae++++TI/-Caches-/
com.apple.Xcode.501/SharedPrecompiledHeaders/TestProj_Prefix-
fijkwwwlohyljhfhtolutjeyyuko/TestProj_Prefix.pch -c /Users/Chris/
Desktop/TestProj/TestProjAppDelegate.m -o /Users/Chris/Desktop/
TestProj/build/TestProj.build/Debug/TestProj.build/Objects-normal/
x86_64/TestProjAppDelegate.o

CompileC build/TestProj.build/Debug/TestProj.build/Objects-normal/
x86_64/MainMenuController.o /Users/Chris/Desktop/TestProj/
MainMenuController.m normal x86_64 objective-c com.apple.compilers.gcc.
4_2
cd /Users/Chris/Desktop/TestProj
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x objective-c -arch x86_64 -fmessage-
length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -
O0 -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/
MacOSX10.6.sdk -mfix-and-continue -mmacosx-version-min=10.6 -gdwarf-2 -
iquote /Users/Chris/Desktop/TestProj/build/TestProj.build/Debug/
TestProj.build/TestProj-generated-files.hmap -I/Users/Chris/Desktop/
TestProj/build/TestProj.build/Debug/TestProj.build/TestProj-own-target-
headers.hmap -I/Users/Chris/Desktop/TestProj/build/TestProj.build/
Debug/TestProj.build/TestProj-all-target-headers.hmap -iquote /Users/
Chris/Desktop/TestProj/build/TestProj.build/Debug/TestProj.build/
TestProj-project-headers.hmap -F/Users/Chris/Desktop/TestProj/build/
Debug -F/Users/Chris/Desktop/TestProj/../../Downloads/gdata-objectivec-
client-1.10.0/Source/build/Debug -I/Users/Chris/Desktop/TestProj/build/
Debug/include -I/Users/Chris/Desktop/TestProj/build/TestProj.build/
Debug/TestProj.build/DerivedSources/x86_64 -I/Users/Chris/Desktop/
TestProj/build/TestProj.build/Debug/TestProj.build/DerivedSources -
DDEBUG=1 -include /var/folders/nI/nIEOBKrOFb4M2Ggj7b0Ae++++TI/-Caches-/
com.apple.Xcode.501/SharedPrecompiledHeaders/TestProj_Prefix-
fijkwwwlohyljhfhtolutjeyyuko/TestProj_Prefix.pch -c /Users/Chris/
Desktop/TestProj/MainMenuController.m -o /Users/Chris/Desktop/TestProj/
build/TestProj.build/Debug/TestProj.build/Objects-normal/x86_64/
MainMenuController.o

/Users/Chris/Desktop/TestProj/MainMenuController.m: In function '-
[MainMenuController click:]':
/Users/Chris/Desktop/TestProj/MainMenuController.m:18: warning: unused
variable 'service'

Ld build/Debug/TestProj.app/Contents/MacOS/TestProj normal x86_64
cd /Users/Chris/Desktop/TestProj
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/gcc-4.2 -arch x86_64 -isysroot /Developer/SDKs/
MacOSX10.6.sdk -L/Users/Chris/Desktop/TestProj/build/Debug -F/Users/
Chris/Desktop/TestProj/build/Debug -F/Users/Chris/Desktop/
TestProj/../../Downloads/gdata-objectivec-client-1.10.0/Source/build/
Debug -filelist /Users/Chris/Desktop/TestProj/build/TestProj.build/
Debug/TestProj.build/Objects-normal/x86_64/TestProj.LinkFileList -
mmacosx-version-min=10.6 -framework Cocoa -framework GData -o /Users/
Chris/Desktop/TestProj/build/Debug/TestProj.app/Contents/MacOS/
TestProj

ld: warning: in /Users/Chris/Downloads/gdata-objectivec-client-1.10.0/
Source/build/Debug/GData.framework/GData, missing required
architecture x86_64 in file
Undefined symbols:
"_OBJC_CLASS_$_GDataServiceGoogleDocs", referenced from:
objc-class-ref-to-GDataServiceGoogleDocs in MainMenuController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Greg Robbins

unread,
Nov 30, 2010, 6:07:00 PM11/30/10
to gdata-objec...@googlegroups.com
If you're building a framework for the library, be sure that the framework is copied into your app bundle, and that your application target links against the framework.

Thomas Van Lenten

unread,
Dec 1, 2010, 6:38:41 AM12/1/10
to gdata-objec...@googlegroups.com
You're compiling for 64bit Intel, I'm not sure if the framework compiles 64bit by default, so you might be mixing a 32bit lib with a 64bit app.  Failing that, are you using service defines to control what code is compiled into the framework?

TVL



--
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.


Chris

unread,
Dec 1, 2010, 12:56:21 PM12/1/10
to Google Data APIs Objective-C Client Library Discussion
Tnx for your reply,

I have added GData.framework to 'Link Binary With Libraries' in my
target's build phases and I have added a 'New Copy Files Build Phase'
where I have set the Destination to 'Frameworks' and have added
GData.framework to the new build phase.

Furthermore when I do CMD+I on my target, in the General Tab under
'Linked Libraries' GData.framework is marked as "Required".

But when I compile I still get the 'Symbols not found' :((((

What am I missing??? I can't figure out what I am doing wrong, or
which step am I missing! :(((

tnx for your reply though!

Chris

unread,
Dec 1, 2010, 1:01:59 PM12/1/10
to Google Data APIs Objective-C Client Library Discussion
Tnx Thomas!!!

I just tried to build the project to 32 bit after reading your post
and it compiles fine!!! damn I hadn't thought of that!!!

Thanks so much to you and Greg who also answered my post!!
(Greg forced me to double check that all the copying and linking was
correct!)

Cheers guys and thanks for the help!
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages