I keep getting this error message and don't know why.
dyld: Library not loaded: libboost_thread.dylib Referenced from: /Users/adhg/Documents/workspace_cpp/Boost_101/Release/Boost_101 Reason: image not found
the code:
#include <iostream>
#include <boost/thread.hpp>
void workerFunction() {
boost::posix_time::seconds workTime(3);
std::cout << "Worker: running" << std::endl;
boost::this_thread::sleep(workTime);
std::cout << "Worker: finished" << std::endl;
}
int main() {
std::cout << "main: startup" << std::endl;
boost::thread workerThread(workerFunction);
std::cout << "main: waiting for thread" << std::endl;
workerThread.join();
std::cout << "main: done" << std::endl;
return 0;
}
What I did is simply follow the instructions here and in many other places, the basics:
- download boost
- unzip to folder
- ./bootstrap.sh
- ./bjam
you will note that the usr/local/boost... is where I actually placed my folder (it exists) and under usr/local/boost_1_54_0/stage/lib I have the libboost_thread and so forth. Still...not sure why I get this error.
My settings looks like this now:
Can anyone point out what am I doing wrong?