如何使用C ++的旧标准编译Boost? (特别是C ++ 03) [英] How to compile Boost with an older std of C++? (C++03 in particular)

查看:750
本文介绍了如何使用C ++的旧标准编译Boost? (特别是C ++ 03)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在依赖于Boost的项目中工作( http://kratos-wiki.cimne.upc .edu / index.php / Main_Page ),这个项目目前只支持C ++ 03。最后更新的gcc ++(v.5)C ++ 11已成为默认std,技术上我解决了修改CXX_FLAGS添加问题:


-std = c ++ 03


问题出现在Boost库中,我无法编译C ++ 03 std(我想,我不知道如何检查与我编译的std)。我尝试使用以下命令编译Boost:


./ b2安装阶段--with-python --with- serialization cxxflags = -std = c ++ 03


我试过修改Jamroot文件,添加以下行:


 < toolset> gcc:< cxxflags> -std = gnu ++ 03 
< toolet> ; clang:< cxxflags> -std = c ++ 03


但是问题仍然存在,当我编译整个项目时,我获得了以下几种警告(几次):


/ usr / local /include/boost/type_traits/detail/template_arity_spec.hpp:13:84:note:#pragma message:注意:不推荐使用此头(template_arity_spec.hpp)
#pragma message(注意:使用此


这是为什么我怀疑我的更改不生效。

$非常感谢您的帮助

解决方案

我认为您可以放心地忽略这些警告目前。我编译boost 1_60_0与gcc 5.2.1和std = c ++ 11,我得到相同的警告。有一个机票,但同时它没有造成我任何问题在这个时候。我注释掉了在boost代码中的两个[#pragma warning]行,所以我没有得到很多分心的输出在我的生成:



boost / type_traits / detail / template_arity_spec.hpp第13行:

  // noisy:#pragma message(注意:使用此标题(template_arity_spec。 hpp)is deprecated)

boost / type_traits / detail / bool_trait_def.hpp第18行:

  // noisy:#pragma message(注意:使用此标题(bool_trait_def.hpp)已弃用)

UPDATE 问题在boost 1.61.0中仍然存在。我再次使用相同的确切解决方案。


I am working in a project dependent of Boost (http://kratos-wiki.cimne.upc.edu/index.php/Main_Page), this project currently only supports C++03. With the last update of gcc++ (v.5) the C++11 has become the default std, technically I solved the problem modifying the CXX_FLAGS adding:

-std=c++03

The problem comes with the Boost library, which I am not able to compile with the C++03 std (I think, I don't know how to check with which std I have compiled). I tried employing the following command to compile Boost:

./b2 install stage --with-python --with-serialization cxxflags="-std=c++03"

I have tried too modify the Jamroot file, adding the following lines:

  <toolset>gcc:<cxxflags>-std=gnu++03
  <toolset>clang:<cxxflags>-std=c++03

But the problem persist, when I compile the whole project I obtain the following kind of warning (several times):

/usr/local/include/boost/type_traits/detail/template_arity_spec.hpp:13:84: note: #pragma message: NOTE: Use of this header (template_arity_spec.hpp) is deprecated # pragma message("NOTE: Use of this header (template_arity_spec.hpp) is deprecated")

That's why I suspect that my changes do not take effect.

Thank you very much for your help

解决方案

I think you can safely ignore those warnings for now. I am compiling boost 1_60_0 with gcc 5.2.1 and std=c++11, and I get the same warnings. There is a ticket on it, but meanwhile it hasn't caused me any problems at this time. I commented out the two [#pragma warning] lines in the boost code, so I don't get a lot of distracting output in my build:

boost/type_traits/detail/template_arity_spec.hpp line 13:

// noisy: # pragma message("NOTE: Use of this header (template_arity_spec.hpp) is deprecated")

boost/type_traits/detail/bool_trait_def.hpp line 18:

// noisy: # pragma message ("NOTE: Use of this header (bool_trait_def.hpp) is deprecated")

UPDATE The problem still exists in boost 1.61.0. I used the same exact fix again.

这篇关于如何使用C ++的旧标准编译Boost? (特别是C ++ 03)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆