2011-11-17 53 views
1

我试图编译生成的一些文件proto.cc在Solaris 10 SPARC 64protobuf的生成文件在Solaris 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的编译器标志:

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

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

感谢, 波格丹

+0

你可能在这里得到一些帮助的SO,但是,我的理解是,核心谷歌维护者不是SO用户。您可能会发现[google小组](http://groups.google.com/group/protobuf)在此实例中很有用。 –

+0

似乎在Solaris上使用的stlport太旧了,即使是studio-11.0.13也是如此。有没有stlport5? – osgx

+0

不,我也试着用studio-12.0.1,它只有stlport4 –

回答

2

好了,所以它煤层我们的代码是建立与本地STL,这意味着我们不能protobuf的链接它建立与stlport4。所以我必须用本地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 

问候, 波格丹

+0

从我所知道的情况来看,这些补丁适用于2.3.0而不适用于2.4.1,并且不适用于干净。你是否必须修复手动失败的黑客? – grantc

+0

是的......脏,但是 –

相关问题