Modify boost.build jamfile to support C ++ 11?

I use boost.build or b2 to create a project. I am trying to add C ++ 11, like auto and begin , but the standard invokation b2 release in the Jamfile directory does not recognize them.

+7
c ++ 11 bjam
source share
2 answers

The following is added to Jamroot

  <toolset>gcc:<cxxflags>-std=gnu++0x <toolset>clang:<cxxflags>-std=c++11 

Seems to work

+8
source share

You need to tell the compiler to enable C ++ 11 support

For example, for gcc you can use

 bjam toolset=gcc cxxflags="-std=c++11" 
+5
source share

All Articles