Sun C++ Compilers and Boost

与世无争的帅哥 提交于 2019-12-07 23:29:21

问题


I am currently developing on OpenSolaris 2009-06. The Boost::MPL Documentation seems to suggest that sun compilers are not supported (the document was last updated in 2004 ). Boost's top level documentation seems to suggest that the sun compilers 5.10 onwards are supported -- I guess this is a general level of support or does this include MPL ?. Does anyone have any details on the state of the C++ conformance of the sun 5.10 compilers ?

I could always compile using GCC.


回答1:


I have had some success with Boost and Sun's CC compiler on Solaris 10, but it is a pain. The main thing to remember is you need,

 -library=stlport4 -features=tmplife -features=tmplrefstatic

in you CXXFLAGS for everything you compile, all the template only libraries I have tried seem to work fine with this,(skip all the libraries which need compiling, see here for details )

This does mean of course, that you will have to rebuild any libraries you need to link to (you would be very lucky if they already used stlport4).

Sadly, this is about the only (tenuously) valid reason for not using Boost :-(

Sun C++ Frontend tails blog




回答2:


I've fought through this problem myself in the past, and it's a pain in the rear.

To be slightly more specific on Chris Huang-Leaver's answer, you really need to use STLPort4 on the Sun compilers. The default STL delivered by Sun is incomplete, per their own documentation (I'll track it down at some point). The other options that Chris mentions are helpful, but they're not really the root of the problem.

The good news is that Sun also delivers STLPort version 4 with their compilers, so all you need is to include the "-library=stlport4" flag in order to switch over to it. Why they deliver two versions (one semi-broken) of the STL, rather than just one correct version, is beyond me.




回答3:


I guess since an exact answer has not been provided I must post one myself.

opensolaris(2009.06) and boost-1.4.1 seem to work well. The ./bjam picks the right switches and boost::mpl seems to work well with the sun compiler present. So, as far as I can tell the mpl documentation on compiler support is quite outdated.



来源:https://stackoverflow.com/questions/1816790/sun-c-compilers-and-boost

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!