Bug #1286
closedWt C++ build failure on mac 10.6 using boost 1.49
Description
Witty is downloaded today with the latest boost version (1.49) built today. Witty build fails with below error messages originating from src/web/random_device.cpp
[ 1%] Building CXX object src/CMakeFiles/wt.dir/web/random_device.o
/Users/Rama/Desktop/wt-3.1.7a/src/web/random_device.cpp:45: error: 'const unsigned int boost::random::random_device::min_value' is not a static member of 'class boost::random::random_device'
/Users/Rama/Desktop/wt-3.1.7a/src/web/random_device.cpp:45: error: uninitialized const 'boost::random::random_device::min_value'
/Users/Rama/Desktop/wt-3.1.7a/src/web/random_device.cpp:46: error: 'const unsigned int boost::random::random_device::max_value' is not a static member of 'class boost::random::random_device'
/Users/Rama/Desktop/wt-3.1.7a/src/web/random_device.cpp:46: error: uninitialized const 'boost::random::random_device::max_value'
/Users/Rama/Desktop/wt-3.1.7a/src/web/random_device.cpp:51: error: 'const char* const boost::random::random_device::default_token' is not a static member of 'class boost::random::random_device'
/Users/Rama/Desktop/wt-3.1.7a/src/web/random_device.cpp: In constructor 'boost::random::random_device::random_device(const std::string&)':
/Users/Rama/Desktop/wt-3.1.7a/src/web/random_device.cpp:162: error: 'max_value' was not declared in this scope
make[2]: * [src/CMakeFiles/wt.dir/web/random_device.o] Error 1
make[1]: * [src/CMakeFiles/wt.dir/all] Error 2
make: * [all] Error 2
What is it with the BOOST_NO_INCLASS_MEMBER_INITIALIZATION macro at line 42 in random_device.cpp? does it need to be passed at command line? if so how?
Updated by Wim Dumon over 12 years ago
Hello,
boost changed their API and implementation of random_lib. New versions of Wt are fixed for these changes. You'll either have to use an old version of boost, a newer version of Wt, or fix the build problem (new versions of Wt may give you inspiration).
Best regards,
Wim.
Updated by Koen Deforche over 12 years ago
- Status changed from New to Resolved
- Assignee set to Wim Dumon
Updated by Peter K over 12 years ago
I have run into the same issue with the current Git-version of Wt and Boost-1.49...
Does this mean that the Git-version of Wt is not the latest version? I am somewhat confused.
Updated by Wim Dumon over 12 years ago
Hello Peter,
Does your boost installation include boost random? I mean, in the lib directory of your boost installation, does it contain the file libboostrandom.... ? You can also look in CMakeCache.txt to see if it was correctly found.
Wt will use the boost library if it can find it, or fallback on its own implementation if it can't find it. Since boost random is part of recent boost libraries, we strongly recommend to use the supplied library (in fact, otherwise you'll see errors like these).
Regards,
Wim.
Updated by Peter K over 12 years ago
I found what I was doing wrong: the flag NO_BOOST_RANDOM was on by default in CMake. Once I turned it off, everything compiled normally.
Thanks!
Peter
Updated by Koen Deforche over 12 years ago
- Status changed from Resolved to Closed
- Target version set to 3.2.2
Released in Wt 3.2.2