我遵循了这个:http ://code.google.com/p/metasyntactic/wiki/ProtocolBuffers
我能够编译 Person.proto 文件
将 .h 和 .m 文件添加到我的静态库项目 (libIOS)
UI 项目引用了 libIOS
现在当我编译时,我在 UI 项目中得到以下错误
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_PBExtensionRegistry", referenced from:
objc-class-ref in libIOS.a(Person.pb.o)
"_OBJC_CLASS_$_PBGeneratedMessage", referenced from:
_OBJC_CLASS_$_Person in libIOS.a(Person.pb.o)
"_OBJC_CLASS_$_PBGeneratedMessage_Builder", referenced from:
_OBJC_CLASS_$_Person_Builder in libIOS.a(Person.pb.o)
"_OBJC_CLASS_$_PBMutableExtensionRegistry", referenced from:
objc-class-ref in libIOS.a(Person.pb.o)
"_OBJC_CLASS_$_PBUnknownFieldSet", referenced from:
objc-class-ref in libIOS.a(Person.pb.o)
"_OBJC_IVAR_$_PBGeneratedMessage.memoizedSerializedSize", referenced from:
-[Person serializedSize] in libIOS.a(Person.pb.o)
"_OBJC_METACLASS_$_PBGeneratedMessage", referenced from:
_OBJC_METACLASS_$_Person in libIOS.a(Person.pb.o)
"_OBJC_METACLASS_$_PBGeneratedMessage_Builder", referenced from:
_OBJC_METACLASS_$_Person_Builder in libIOS.a(Person.pb.o)
"_computeInt32Size", referenced from:
-[Person serializedSize] in libIOS.a(Person.pb.o)
"_computeStringSize", referenced from:
-[Person serializedSize] in libIOS.a(Person.pb.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
项目 libIOS 符合要求,没有错误
项目 UI 给出了上述错误