在 Xcode 中使用两个框架时出错

Error working with two frameworks in Xcode

我需要在我的 Xcode 项目中使用两个第三方框架,但其中两个使用 Google 的 Protocol Buffer 库,并且它们是针对该库的不同版本编译的。这两个框架单独工作都很好,但是当我尝试在同一个项目中使用它们时,我收到此错误消息:

[libprotobuf FATAL /Users/jari/dev/indooratlas-sdk/indooratlas-ios-sdk/target/framework/IDAAlgorithm/cpp-algorithms/cpp/protobuf/protobuf-cmake/protobuf-2.6.0/src/google/protobuf/stubs/common.cc:72] This program was compiled against version 2.4.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (2.6.0).  Contact the program author for an update.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "".)
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException: This program was compiled against version 2.4.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (2.6.0).  Contact the program author for an update.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "".)

错误消息指出我应该联系程序作者以获得更新,但我想知道我是否可以做些什么来解决这个问题。

如果您有框架的源代码,您应该能够使用最新版本的 Protobufs 编译它们。您将需要使用最新的 protoc 和 link 针对最新的库版本重新生成所有 .pb2.cc.pb2.h 文件。

如果您没有框架的源代码,那么您需要联系作者并要求他们针对较新的 Protobufs 进行编译。没有代码,您自己无法做到这一点。