2012-02-11 118 views
2

我想编译谷歌protobuf协议使用它在我的iOS 5项目,但没有成功呢......我只发现了一篇关于主题here的博客文章。但是,当我尝试这种方法我收到错误:iOS 5,Xcode 4.2和ProtoBuf

h-3.2# make 
make all-recursive 
Making all in . 
make[2]: Nothing to be done for `all-am’. 
Making all in src 
protoc -I. –cpp_out=. google/protobuf/unittest.proto google/protobuf/unittest_empty.proto google/protobuf/unittest_import.proto google/protobuf/unittest_mset.proto google/protobuf/unittest_optimize_for.proto google/protobuf/unittest_embed_optimize_for.proto google/protobuf/unittest_custom_options.proto google/protobuf/unittest_lite.proto google/protobuf/unittest_import_lite.proto google/protobuf/unittest_lite_imports_nonlite.proto google/protobuf/unittest_no_generic_services.proto google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto 
google/protobuf/unittest.proto:490:46: Expected number. 
google/protobuf/unittest.proto:491:51: Expected number. 
google/protobuf/unittest.proto:492:46: Expected number. 
google/protobuf/unittest.proto:493:44: Expected number. 
google/protobuf/unittest.proto:494:49: Expected number. 
google/protobuf/unittest.proto:495:44: Expected number. 
make[2]: *** [unittest_proto_middleman] Error 1 
make[1]: *** [all-recursive] Error 1 
make: *** [all] Error 2 

我已经与protobuf旧项目,但它是在xcode 3.x中创建的。 有没有一种方法或一些教程如何在xcode 4.2和armv7架构中使用它? 我失去了我的项目时间2天,研究问题,仍然没有成功...我的项目期限很快,我没有机会继续没有这protobuf ...

回答

1
+0

是的,我已经尝试了我发现的所有东西...但没有成功与xcode 4.2和iOS 5 protobuf .. – donjordano 2012-02-11 22:44:22

+0

那么你在问题中发布的构建输出看起来像谷歌的官方protobuf库。当您尝试使用Cyrus Najmabadi的客观c实现时发生了什么? – pepsi 2012-02-12 01:14:39

+0

使用此实现时,我在xcode中收到链接器错误... – donjordano 2012-02-12 07:40:43

0

This blog post给出了如何使用armv7,armv7s,i386体系结构编译protobuf库的说明。博客文章中还有一个链接,用于下载针对protobuf的预编译的iOS库,以及模拟器。