protobuf生成的文件无法在Solaris SPARC 64上编译

时间:2011-11-17 12:53:51

标签: compiler-construction 64-bit solaris protocol-buffers

我正在尝试在Solaris 10 SPARC 64上编译一些生成的proto.cc文件。

我得到了这些错误:

"/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编译器标志:

CXXFLAGS = -xmemalign=8s -g0 -xO3 -xlibmil -xdepend -xbuiltin -mt -compat=5 -library=stlport4 -library=Crun -template=no%extdef  -DNDEBUG -m64 -xarch=v9 

protobuf编译成功(所有测试都通过)

谢谢, 波格丹

1 个答案:

答案 0 :(得分:2)

好的,所以我们的代码是用本机stl构建的,这意味着我们无法将它与使用stlport4的protobuf构建链接起来。所以我不得不用本地stl。

构建protobuf

以下是步骤:

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

此致 波格丹