gpt4 book ai didi

c++ - 编译 Caffe 时未定义对 leveldb 的引用

转载 作者:行者123 更新时间:2023-11-30 03:45:16 25 4
gpt4 key购买 nike

我的操作系统是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,编译会成功,但示例无法运行。

最佳答案

好的... 2 小时前我自己解决了这个问题。我放弃使用 CMake 并在 makefile.configure 中做了一些更改:

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/lib/x86_64-linux-gnu/hdf5/serial/include /home/vic/leveldb/include/leveldb /opt/OpenBLAS/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /home/vic/leveldb /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial /opt/OpenBLAS/lib

我只是添加了一系列我认为可能是的图书馆地址。 最后,我通过 make all 使用 levelDB 成功编译了 Caffe,并成功运行了 mnist。如果这些库与早期版本不在同一个地方,她可能真的找不到这些库。

关于c++ - 编译 Caffe 时未定义对 leveldb 的引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34893578/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com