2012-01-05 71 views
0

我正在尝试制作使用协议缓冲区的应用程序。我收到这个错误,为什么?使用protobuf的架构i386的未定义符号

Ld /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator/PBTest.app/PBTest normal i386 
cd /Users/fmota/Documents/Developer/Protobuf/PBTest 
setenv MACOSX_DEPLOYMENT_TARGET 10.6 
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/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator -F/Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator -filelist /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Intermediates/PBTest.build/Debug-iphonesimulator/PBTest.build/Objects-normal/i386/PBTest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework SystemConfiguration -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/fmota/Library/Developer/Xcode/DerivedData/PBTest-gvudadeakgzklbekugyiqyfyprlt/Build/Products/Debug-iphonesimulator/PBTest.app/PBTest 

Undefined symbols for architecture i386: 
    "_OBJC_CLASS_$_AreaRequest_Builder", referenced from: 
     objc-class-ref in ViewController.o 
ld: symbol(s) not found for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

回答

0

是的,这是我见过的一个常见问题。

查看this nearly duplicate question的回答,并告诉我它是否能解决您的问题。 :-)

+0

不,它没有解决它.. :( – 2012-01-05 16:23:04

0

将* .pb.h和* .pb.m添加到“TARGET” - >“Build Phases” - >“Compile Sources”中!

0

我的工作环境是xcode 5.0.2。

添加* .pb.m到 “目标” - > “构建阶段” - > “编译源”

不要加上* .pb.h,之后我加* .pb.h,它不能链接。

相关问题