[Random] random_device and windows - multiply defined symbols
The release notes for Boost 1.43 says "Put the implementation of random_device in a compiled lib, and added Windows support." Trying to use this library does not seem to work for me, under visual studio 2005, with static libraries. #include <cstdlib> #include <boost/nondet_random.hpp> int main(int argc, char* argv[]) { boost::random_device d; return EXIT_SUCCESS; } 1>libboost_random-vc80-mt-sgd-1_43.lib(random_device.obj) : error LNK2005: "public: static bool const boost::random_device::has_fixed_range" (?has_fixed_range@random_device@boost@@2_NB) already defined in main.obj 1>libboost_random-vc80-mt-sgd-1_43.lib(random_device.obj) : error LNK2005: "public: static unsigned int const boost::random_device::min_value" (?min_value@random_device@boost@@2IB) already defined in main.obj 1>libboost_random-vc80-mt-sgd-1_43.lib(random_device.obj) : error LNK2005: "public: static unsigned int const boost::random_device::max_value" (?max_value@random_device@boost@@2IB) already defined in main.obj 1>Debug\Win32\random_device.exe : fatal error LNK1169: one or more multiply defined symbols found -- Eld på åren og sol på eng gjer mannen fegen og fjåg. [Jøtul] <demo> 2010 Tore Halvorsen || +052 0553034554
AMDG Tore Halvorsen wrote:
The release notes for Boost 1.43 says "Put the implementation of random_device in a compiled lib, and added Windows support."
Trying to use this library does not seem to work for me, under visual studio 2005, with static libraries.
#include <cstdlib> #include <boost/nondet_random.hpp>
int main(int argc, char* argv[]) { boost::random_device d; return EXIT_SUCCESS; }
Use a shared library or apply the patch from https://svn.boost.org/trac/boost/changeset/62347/branches/release/libs/rando... In Christ, Steven Watanabe
On Mon, May 31, 2010 at 7:00 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
Use a shared library or apply the patch from https://svn.boost.org/trac/boost/changeset/62347/branches/release/libs/rando...
Works great :) Thanks. -- Eld på åren og sol på eng gjer mannen fegen og fjåg. [Jøtul] <demo> 2010 Tore Halvorsen || +052 0553034554
participants (2)
-
Steven Watanabe
-
Tore Halvorsen