protobuf2.5 iphone5s中崩溃的问题

我们的游戏用到了protobuf2.5,在其他版本中都是好的,但iphone5s中崩溃,表现为针对DescriptorPool为空了。网上也找不到什么信息,xiaozhong同学各种尝试,都没有搞定,太TMD折腾了。后来从这里获取了解决方案:

http://stackoverflow.com/questions/19848118/weird-ios-libprotobuf-dylib-cause-crash/20406591#20406591

 

Yes, ImageLoader on the newer devices (iPhone 5S and apparently iPad air) has its own copy of Protocol Buffers which causes symbol collisions.

I hacked around this by editing my google/protobuf/stubs/common.h and inserting the following line near the top of the file:

#define google myapp

Now, my copy of the Google protobuf implementation uses the namespace "myapp" instead of "google" and so the symbols don't collide with the system ones.

按照这个提示修改后,就可以了。我只是大致知道怎么回事,有时间再回来分析具体原因。

你可能感兴趣的:(protobuf)