当我使用g ++编译器运行以下代码时,它运行得很好。 然后,当我尝试在ns3中使用waf运行它时,出现以下错误
challenge.cc:(.text.startup+0xc): undefined reference to
`boost::random::random_device::random_device()'
这是代码
#include <iostream>
#include <boost/random.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/random/random_device.hpp>
int main()
{
using namespace boost::multiprecision;
using namespace boost::random;
boost::random::random_device seeder;
boost::random::mt19937 rng(seeder());
typedef independent_bits_engine<mt19937, 512, uint512_t> generator512_type;
generator512_type gen512(rng);
uint512_t challenge;
challenge = gen512();
std::cout << "The challenge is: " << challenge << std::endl;
return 0;
}
任何想法如何解决?