Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build Boost with C++0x support?

I don't know how to build Boost with C++0x compilers. Which option must be given to bjam? Should the user.config file be modified?Can someone help me?

Best, Vicente

like image 320
Vicente Botet Escriba Avatar asked May 22 '10 10:05

Vicente Botet Escriba


People also ask

Can I build Boost with CMake?

However, this Infrastructure does setup more granular targets (like Boost::signals2 instead of Boost::headers ) and provide the ability to build compile-necessary targets too (like filesystem). That infrastructure does warn in their README that building Boost with CMake does not work yet and is not supported .

How do you add Boost in C++?

In the properties dialog, select "Configuration Properties" and then "VC++ Directories". You will need to add the Boost include path to the "Include Directories" list. If you're using all header-only libraries then you're done. Otherwise, you will need to add the Boost library path to "Library Directories".

Does Boost come with C++?

Welcome to Boost.org!Boost provides free peer-reviewed portable C++ source libraries.


1 Answers

I have found the answer. I was waiting for a features something like 'std' and call it as follows:

bjam std=0x 

but currently we need to use the low level variables cxxflags and add the specific compiler flags. For example for gcc we can do

bjam toolset=gcc cxxflags=-std=gnu++0x 

Other compilers will need a different setting.

Waiting for a new Boost.Build feature, you can also define your own toolset as follows: Add the user.config or site.config file

using gcc    : std0x    : "/usr/bin/g++" # your path to the C++0x compiler    : <cxxflags>-std=gnu++0x    ; 

And now call as

bjam toolset=gcc-std0x 
like image 156
Vicente Botet Escriba Avatar answered Sep 21 '22 19:09

Vicente Botet Escriba