2012-01-05 108 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,它不能鏈接。

相關問題