更新时间:2021-12-15 15:21:46
我怀疑这是一个C + + ABI问题。在GCC 5(与C ++ 11相关的要求,但它适用,即使你不使用C ++ 11)中更改了 std :: string
的ABI。请参阅:
I suspect this is a C++ ABI issue. The ABI for std::string
has changed in GCC 5 (related to C++11 requirements, but it applies even if you aren't using C++11). See:
https://gcc.gnu .org / gcc-5 / changes.html#libstdcxx
如果libprotobuf是使用GCC 4.x或之前版本构建的, 5,那么你会看到问题,因为libprotobuf在其接口中使用 std :: string
。您有两个选项:
If libprotobuf was built with GCC 4.x or prior, but your app is built with GCC 5, then you will see problems, because libprotobuf uses std::string
in its interface. You have two options:
-D_GLIBCXX_USE_CXX11_ABI = 0
构建应用程序。这将强制GCC使用旧的ABI版本。-D_GLIBCXX_USE_CXX11_ABI=0
as described at the above link. This will force GCC to use the old ABI version.