2011-11-17 55 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

是的......髒,但是 –

相關問題