protobuf 生成的文件无法在 Solaris SPARC 64 上编译 [英] protobuf generated files does not compile on Solaris SPARC 64
本文介绍了protobuf 生成的文件无法在 Solaris SPARC 64 上编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在 Solaris 10 SPARC 64 上编译一些生成的 proto.cc 文件.
I am trying to compile some generated proto.cc files on Solaris 10 SPARC 64.
我收到这些错误:
"/apps/pkgs/studio-11.0.13/prod/include/CC/stlport4/stl/_alloc.h", line 134: Error: The function "__stl_new" must have a prototype.
"/apps/pkgs/studio-11.0.13/prod/include/CC/stlport4/stl/_alloc.h", line 135: Error: The function "__stl_delete" must have a prototype.
"/apps/pkgs/studio-11.0.13/prod/include/CC/stlport4/./stdexcept", line 52: Error: _STLP_EXCEPTION_BASE is not defined.
编译器标志是:
/apps/pkgs/studio-11.0.13/prod/bin/CC -xarch=v9 -library=stlport4 -library=Crun -features=no%conststrings -library=no%rwtools7 -erroff=nonewline
protobuf 编译器标志:
protobuf compiler flags:
CXXFLAGS = -xmemalign=8s -g0 -xO3 -xlibmil -xdepend -xbuiltin -mt -compat=5 -library=stlport4 -library=Crun -template=no%extdef -DNDEBUG -m64 -xarch=v9
protobuf 编译成功(所有测试通过)
protobuf was compiled successfully(all tests passed)
谢谢,博格丹
推荐答案
好吧,看来我们的代码是使用原生 stl 构建的,这意味着我们无法将它与使用 stlport4 的 protobuf 构建链接起来.所以我不得不用原生 stl 构建 protobuf.
Ok, so it seams that our code is build with native stl, which means we cannot link it with protobuf build with stlport4. So I had to build protobuf with native stl.
步骤如下:
1. You have to apply these patches: https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/protobuf/trunk/files/
2.Run ./configure with these parameters:
./configure LDFLAGS=-L$PWD/src/solaris --disable-64bit-solaris --prefix=/bogdan/protobuf-2.4.1
If you want to build it on SPARC 64, remove --disable-64bit-solaris and edit protobuf-2.4.1/src/solaris/libstdc++.la file to add the correct dependecies to the linker.
3. Run: make, make check and make install
问候,博格丹
这篇关于protobuf 生成的文件无法在 Solaris SPARC 64 上编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文