我正在尝试从可可应用程序的YouTube频道获取视频。为此,首先将GData框架添加到我的项目中,并导入#import "GData/GData.h“。那么它们就不是错误的。但是如果我导入#import "GData/GDataServiceGoogleYouTube.h“
并编写一些与GDataServiceGoogleYouTube相关的代码
GDataServiceGoogleYouTube *service=[[GDataServiceGoogleYouTube alloc]init]; 获取编译器错误:
Ld /Users/Rasheed/Library/Developer/Xcode/DerivedData/YouTube-ddawzlgkbmkdqsalghaobsospjth/Build/Products/Debug/YouTube.app/Contents/MacOS/YouTube normal x86_64
cd /Users/Rasheed/Desktop/MULTIPLESOCKET/YouTube
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/clang -arch x86_64 -isysroot
/Developer/SDKs/MacOSX10.6.sdk -L/Users/Rasheed/Library/Developer/Xcode/DerivedData/YouTube-ddawzlgkbmkdqsalghaobsospjth/Build/Products/Debug
-F/Users/Rasheed/Library/Developer/Xcode/DerivedData/YouTube-ddawzlgkbmkdqsalghaobsospjth/Build/Products/Debug -filelist
/Users/Rasheed/Library/Developer/Xcode/DerivedData/YouTube-ddawzlgkbmkdqsalghaobsospjth
/Build/Intermediates/YouTube.build/Debug/YouTube.build/Objects-normal/x86_64/YouTube.LinkFileList -mmacosx-version-min=10.6 -ObjC
-lxml2 -all_load -framework Cocoa -o /Users/Rasheed/Library/Developer/Xcode/DerivedData/YouTube-ddawzlgkbmkdqsalghaobsospjth/Build
/Products/Debug/YouTube.app/Contents/MacOS/YouTube
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GDataServiceGoogleYouTube", referenced from:
objc-class-ref in YouTubeAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)如何修复此错误?
发布于 2012-03-01 14:04:09
如果您构建了一个GData静态库,请确保该库列在目标的“构建阶段”选项卡下的“Link Binary With Libraries”部分中。
如果您将所有的GData源文件拖到您的项目中,请确保它们都列在目标的“构建阶段”选项卡下的“编译源”部分中。
你可能会发现这篇博文很有帮助:http://hoishing.wordpress.com/2011/08/23/gdata-objective-c-client-setup-in-xcode-4/
https://stackoverflow.com/questions/9511316
复制相似问题