Bug #1580
closedcompilation errors (boost random)
0%
Description
Hello!
I tried to compile Wt 3.2.3.
I got the following error message:
wt-3.2.3/src/web/random_device.cpp:48:63: error: ‘const result_type boost::random::random_device::min_value’ is not a static member of ‘class boost::random::random_device’
wt-3.2.3/src/web/random_device.cpp:48:41: error: uninitialized const ‘boost::random::random_device::min_value’ [-fpermissive]
wt-3.2.3/src/web/random_device.cpp:49:63: error: ‘const result_type boost::random::random_device::max_value’ is not a static member of ‘class boost::random::random_device’
wt-3.2.3/src/web/random_device.cpp:49:41: error: uninitialized const ‘boost::random::random_device::max_value’ [-fpermissive]
wt-3.2.3/src/web/random_device.cpp:54:42: error: ‘const char* const boost::random::random_device::default_token’ is not a static member of ‘class boost::random::random_device’
wt-3.2.3/src/web/random_device.cpp: In constructor ‘boost::random::random_device::random_device(const string&)’:
wt-3.2.3/src/web/random_device.cpp:165:3: error: ‘max_value’ was not declared in this scope
Boost 1.48. Boost-random is not installed.
Updated by Wim Dumon over 12 years ago
Install boost.random, and try again, possibly you'll have to set BOOST_NO_RANDOM to false. boost.random used to be an optional Wt dependency, but for more-or-less recent boost versions it's required.
BR,
Wim.
Updated by Boris Nagaev over 12 years ago
Hello!
I can't install boost.random on that machine (no permissions to do that).
There is not BOOST_NO_RANDOM in list of options produced by ccmake.
Same error on Wt 3.1.2
Why boost.random is required for newer boost versions?
Updated by Wim Dumon over 12 years ago
- Status changed from New to Resolved
Well that's an interesting and weird story indeed. In the beginning, boost.random was only a header file but did not provide the implementation for the random number generator. Thus Wt had to include its own cpp file that implements that class. Then, boost probably realized that this is weird, so they did create an implementation, and added it as a library to boost. Wt did not link to this library, as it had its own implementation of the interface, and actually we never really noticed that there was suddenly a random library. But since boost now had a library, they started to change the data members of the class, probably because they assumed that there was no problem if they changed the library and the header file together. These changes are not backward-compatible, and Wt's implementation of the library therefore no longer compiles. Since it doesn't make sense to duplicate boost's random implementation (and keeping track of the correct implementation for the correct version), we decided to link to boost.random if we find it, and use our own implementation if we don't find it. So if your boost has a random library, it's better to use that than Wt's implementation, and starting from boost I-dont-know-what-number (1.46?), you don't even have the choice anymore.
Of course, to solve your particular situation, you can update Wt's random implementation, but you're on your own then.
BR,
Wim.
Updated by Boris Nagaev over 12 years ago
Could you copy both headers and sources of boost.random to Wt and use it if boost.random is not available, please?
Otherwise you should mention boost.random in installation howto, as well as other required boost libraries.
Or you can make Wt.Random optional and disable it if boost.random is not available.
Updated by Koen Deforche over 12 years ago
- Status changed from Resolved to Closed