Boost.Random - random_device error LNK2019 ()

Hello there! Windows XP, Boost 1.38, VC++ 7.1 / Mingw 3.4.2 sample code: //----------------------------------------------------- #include <boost/random/uniform_int.hpp> #include <boost/random/variate_generator.hpp> #include <boost/nondet_random.hpp> int main() { boost::random_device m; typedef boost::uniform_int<> distribution_type; distribution_type generator2(m()); return 0; } //----------------------------------------------------- VC++ Output: error LNK2019: unresolved external symbol "public: __thiscall boost::random_device::~random_device(void)" (??1random_device@boost@@QAE@XZ) referenced in function "protected: void __thiscall CGraphDoc::OnBtnNewnode(void)" (?OnBtnNewnode@CGraphDoc@@IAEXXZ) error LNK2019: unresolved external symbol "public: unsigned int __thiscall boost::random_device::operator()(void)" (??Rrandom_device@boost@@QAEIXZ) referenced in function "protected: void __thiscall CGraphDoc::OnBtnNewnode(void)" (?OnBtnNewnode@CGraphDoc@@IAEXXZ) error LNK2019: unresolved external symbol "public: __thiscall boost::random_device::random_device(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0random_device@boost@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "protected: void __thiscall CGraphDoc::OnBtnNewnode(void)" (?OnBtnNewnode@CGraphDoc@@IAEXXZ) error LNK2001: unresolved external symbol "private: static char const * const boost::random_device::default_token" (?default_token@random_device@boost@@0QBDB) fatal error LNK1120: 4 unresolved externals MinGW gave same output I checked the sources and find no implementation of ~random_device and etc... Can anyone help please? -- View this message in context: http://www.nabble.com/Boost.Random---random_device-error-LNK2019-%28%29-tp22... Sent from the Boost - Users mailing list archive at Nabble.com.

AMDG Valen wrote:
Hello there!
Windows XP, Boost 1.38, VC++ 7.1 / Mingw 3.4.2
sample code:
//----------------------------------------------------- #include <boost/random/uniform_int.hpp> #include <boost/random/variate_generator.hpp> #include <boost/nondet_random.hpp>
int main() {
boost::random_device m; typedef boost::uniform_int<> distribution_type; distribution_type generator2(m());
return 0; } <snip>
MinGW gave same output
I checked the sources and find no implementation of ~random_device and etc...
The implementation is in libs/random/random_device.cpp However, it may not work because it is conditioned on: #if defined(__linux__) || defined (__FreeBSD__) In Christ, Steven Watanabe
participants (2)
-
Steven Watanabe
-
Valen