This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/43915] Compiler flags error: error: invalid initialization of reference of type 'boost::thread&&' from expression of type 'boost::thread'



------- Comment #11 from mlrus at mac dot com  2010-05-14 13:25 -------
The following shows how to patch, compile and use boost 1.43.0 with g++
-std=c++0x. ?At issue are the rvalue references and typecasts in the boost
threading libraries. ?Simply tell Boost not to use its rvalue reference code
when it gets compiled, even with option std=c++0x is set. ?Here's how:


1. Modify operatingSystem.jam, to compile with the -std=c+0x option. ?Also,
remove the -no-cpp-precomp option
if it is not supported by your compiler. ?For OS X ?I
changed?tools/build/v2/tools/darwin.jam?at line 483 like this
# Misc options.
#flags darwin.compile OPTIONS : -no-cpp-precomp -gdwarf-2 ;
flags darwin.compile OPTIONS : -std=c++0x -gdwarf-2 ;


2. Modify gcc.hpp to disable the conditional compilation of rvalue references
(temporarily, until that part of the code works with g++)
diff gcc.hpp.orig gcc.hpp
124c124,125
# define BOOST_HAS_RVALUE_REFS
// # define BOOST_HAS_RVALUE_REFS
# define BOOST_NO_RVALUE_REFERENCES

In this manner you can compile and use Boost 1.43 fine gcc 4.5 or earlier, and
still build your software to use the c++0x features supported by the gnu
copmiler option -std=c++0x. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43915


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]