各位大神,我在ubuntu16.04中安装caffe,进行到make all的时候报了如下错误:
CXX/LD -o .build_release/test/test_all.testbin src/caffe/test/test_caffe_main.cpp
.build_release/src/caffe/test/test_benchmark.o:在函数‘void boost::this_thread::sleep >(boost::date_time::subsecond_duration const&)’中:
test_benchmark.cpp:(.text._ZN5boost11this_thread5sleepINS_9date_time18subsecond_durationINS_10posix_time13time_durationELl1000EEEEEvRKT_[_ZN5boost11this_thread5sleepINS_9date_time18subsecond_durationINS_10posix_time13time_durationELl1000EEEEEvRKT_]+0x25a):对‘boost::this_thread::hidden::sleep_until(timespec const&)’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::thread::start_thread_noexcept()’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::thread::detach()’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::detail::thread_data_base::~thread_data_base()’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::thread::native_handle()’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::thread::interrupt()’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::this_thread::interruption_point()’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::detail::set_tss_data(void const*, boost::shared_ptrboost::detail::tss_cleanup_function, void*, bool)’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::thread::interruption_requested() const’未定义的引用
.build_release/lib/libcaffe.so:对‘vtable for boost::detail::thread_data_base’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::detail::get_current_thread_data()’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::thread::joinable() const’未定义的引用
.build_release/lib/libcaffe.so:对‘typeinfo for boost::detail::thread_data_base’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::detail::get_tss_data(void const*)’未定义的引用
.build_release/lib/libcaffe.so:对‘boost::thread::join_noexcept()’未定义的引用
collect2: error: ld returned 1 exit status
Makefile:603: recipe for target '.build_release/test/test_all.testbin' failed
make: *** [.build_release/test/test_all.testbin] Error 1
一直没有找到有效的解决办法.麻烦遇到过的朋友指点迷津.定重谢!
您说的是Makefile.config里面这个么?
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial
我看了下 /usr/lib /路径下有libboost_thread.so libboost_system.so这些文件, /usr/local/lib路径下有libboost_graph.so libboost_regex.so libboost_thread.so...这些文件,但是还是出现上面的错误.
加到编译路径这个,我理解的是不是不对.
这个格式好点,方便您看.
加上 -DBOOST_THREAD_USE_LIB=1 编译参数看看
通常是版本不对引起,试着换个版本的boost