【发布时间】:2016-04-25 22:00:56
【问题描述】:
我的操作系统是 ubuntu15.10。当我使用 CMake 编译 Caffe 时,我得到了这些错误:
[ 95%] Built target train_net
Scanning dependencies of target classification
../lib/libcaffe.so: undefined reference to ‘leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)’
../lib/libcaffe.so: undefined reference to ‘leveldb::Status::ToString() const’
collect2: error: ld returned 1 exit status
tools/CMakeFiles/caffe.bin.dir/build.make:126: recipe for target 'tools/caffe' failed
make[2]: *** [tools/caffe] Error 1
CMakeFiles/Makefile2:406: recipe for target 'tools/CMakeFiles/caffe.bin.dir/all' failed
make[1]: *** [tools/CMakeFiles/caffe.bin.dir/all] Error 2
我已经安装了 libleveldb-dev。
如果我在 CMakeLists 中使 USE_LEVELDB "Build with levelDB" 变为 OFF,编译会成功,但示例无法运行。
【问题讨论】:
标签: c++ cmake undefined-reference caffe leveldb