简体   繁体   English

Sun C ++编译器和Boost

[英]Sun C++ Compilers and Boost

I am currently developing on OpenSolaris 2009-06. 我目前正在使用OpenSolaris 2009-06进行开发。 The Boost::MPL Documentation seems to suggest that sun compilers are not supported (the document was last updated in 2004 ). Boost :: MPL文档似乎表明不支持 Sun编译器(该文档的最新更新时间为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 ?. Boost的顶级文档似乎建议支持Sun编译器5.10及更高版本-我想这是一般支持级别,或者这包括MPL吗? Does anyone have any details on the state of the C++ conformance of the sun 5.10 compilers ? 是否有人对sun 5.10编译器的C ++一致性状态有任何详细信息?

I could always compile using GCC. 我总是可以使用GCC进行编译。

I have had some success with Boost and Sun's CC compiler on Solaris 10, but it is a pain. 我在Solaris 10上使用Boost和Sun的CC编译器取得了一些成功,但这很痛苦。 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 ) 在CXXFLAGS中,对于您编译的所有内容,我尝试过的所有仅模板库似乎都可以正常使用(跳过所有需要编译的库, 请参见此处以了解详细信息

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). 当然,这的确意味着您将必须重建需要链接到的所有库(如果它们已经使用过stlport4,您将非常幸运)。

Sadly, this is about the only (tenuously) valid reason for not using Boost :-( 不幸的是,这是不使用Boost的唯一(长期的)正当理由:-(

Sun C++ Frontend tails blog Sun C ++ Frontend尾巴博客

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. 为了更具体地说明Chris Huang-Leaver的答案,您确实需要在Sun编译器上使用STLPort4。 The default STL delivered by Sun is incomplete, per their own documentation (I'll track it down at some point). 根据Sun自己的文档,它提供的默认STL不完整(我有时会对其进行跟踪)。 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. 好消息是,Sun 随编译器一起提供了STLPort版本4,因此您所需要的就是包括“ -library = stlport4”标志以便切换到该版本。 Why they deliver two versions (one semi-broken) of the STL, rather than just one correct version, is beyond me. 他们为什么提供两个版本的STL(一个半破损),而不仅仅是一个正确的版本,这超出了我的范围。

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. opensolaris(2009.06)和boost-1.4.1似乎运行良好。 The ./bjam picks the right switches and boost::mpl seems to work well with the sun compiler present. ./bjam选择正确的开关,然后boost::mpl似乎可以与现有的sun编译器一起很好地工作。 So, as far as I can tell the mpl documentation on compiler support is quite outdated. 因此,据我所知,关于编译器支持的mpl文档已经过时了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM