0

プロトコルバッファを使用するアプリを作成しようとしています。このエラーが発生します。理由は何ですか?

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)
4

3 に答える 3

0

*.pb.h と *.pb.m を "TARGET" -> "Build Phases" -> "Compile Sources" に追加してください!

于 2013-08-28T09:13:25.510 に答える
0

はい、これは私が見た一般的な問題です。

このほぼ重複した質問への回答を確認して、問題が解決するかどうかをお知らせください。:-)

于 2012-01-05T16:12:51.737 に答える
0

私の作業環境はxcode 5.0.2です。

*.pb.m を "TARGET" -> "Build Phases" -> "Compile Sources" に追加します

*.pb.h を追加しないでください。*.pb.h を追加した後、リンクできません。

于 2014-02-05T04:08:04.347 に答える