Undefined reference to boost::thread functions when building Caffe

六月ゝ 毕业季﹏ 提交于 2020-01-05 07:17:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!