undefined references to boost::random_device

Sep 15, 2015 at 4:31 PM
I have updated my boost lib, there are already mode than 4 versions released; I have installed 1.59.0. When I have tried to build an application that uses c++rest sdk (version 2.5.0) and it seems that I got some undefined references to boost's random_device:
/usr/local/lib/libcpprest.so: undefined reference to `boost::random::random_device::operator()()'
/usr/local/lib/libcpprest.so: undefined reference to `boost::random::random_device::~random_device()'
/usr/local/lib/libcpprest.so: undefined reference to `boost::random::random_device::random_device()'
Does anyone know about this problem?

I have read about the update to 1.58 version of boost, but for windows and I use linux (ubuntu). Shall I switch boost to 1.58 or 1.57 or installing c++rest 2.6.0? or both?
Sep 16, 2015 at 1:48 PM
Edited Sep 16, 2015 at 4:31 PM
I have installed boost 1.58 (after uninstalling all boost 1.59 and the 1.54 - implicit linux: libboost-dev). And it did not worked, I have got the same problems. So I have build cpprest 2.6 and now it works.

I wonder does it need to rebuild the cpprest lib after installing a boost lib? I have seen that when I built the new cpprest, that there were some likes mentioning the version of boost that is installed on the machine, so I am thinking that the old version of cpprest was linked to the older version of boost and maybe that was the problem before. After removing all the implicit linux boost things, I had some problems of
libboost_system.so.1.54.0, not found
What I have also saw is that the test are not all passed, about the client (this is what I remembered, but there were others)
Sep 18, 2015 at 8:48 PM
When you build c++rest on linux for linux, it will use the version of boost you have installed locally.

It sounds like this was your issue -- if you update your local boost packages to a new version of boost, you will need to rebuild c++rest if you're using dynamic linking.
Marked as answer by opreanstefan on 9/22/2015 at 12:28 AM