问题
I'm trying to compile Caffe on Ubuntu 14.04. I keep getting undefined reference to 'boost::thread::...'
errors in the linking phase.
I searched the web and found many people with similar problems and tried pretty much everything I found (too many to list here).
I tried among other things installing boost using apt-get:
- sudo apt-get install libboost-python-dev
- sudo apt-get install libboost-all-dev
Also tried building and installing from the sources:
- sudo ./b2 --threading=multi -j4 --with-thread install
- sudo ./b2 --threading=multi -j4 --with-thread install -a link=static
The errors I keep getting are:
CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::join()'
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::~thread()'
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::start_thread()'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1
make: *** Waiting for unfinished jobs....
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::join()'
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::~thread()'
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::start_thread()'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/caffe.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::join()'
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::~thread()'
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::start_thread()'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/upgrade_net_proto_binary.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::join()'
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::~thread()'
.build_release/lib/libcaffe.so: undefined reference to `boost::thread::start_thread()'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/extract_features.bin] Error 1
来源:https://stackoverflow.com/questions/44928719/undefined-reference-to-boostthread-functions-when-building-caffe