ubuntu - Caffe 链接错误,但 ldd 没有给出错误
问题描述
我正在使用 Ubuntu 16.04 在 Odroid 上构建 caffe,但出现链接错误:
[ 77%] Linking CXX executable compute_image_mean
CMakeFiles/compute_image_mean.dir/compute_image_mean.cpp.o: In function `std::string* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)':
compute_image_mean.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x28): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
CMakeFiles/compute_image_mean.dir/compute_image_mean.cpp.o: In function `std::string* google::MakeCheckOpString<unsigned int, int>(unsigned int const&, int const&, char const*)':
compute_image_mean.cpp:(.text._ZN6google17MakeCheckOpStringIjiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIjiEEPSsRKT_RKT0_PKc]+0x28): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
CMakeFiles/compute_image_mean.dir/compute_image_mean.cpp.o: In function `main':
compute_image_mean.cpp:(.text.startup+0xe6): undefined reference to `google::SetUsageMessage(std::string const&)'
../lib/libcaffe.so.1.0.0: undefined reference to `cv::imread(std::string const&, int)'
../lib/libcaffe.so.1.0.0: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
../lib/libcaffe.so.1.0.0: undefined reference to `cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
../lib/libcaffe.so.1.0.0: undefined reference to `leveldb::Status::ToString() const'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/compute_image_mean.dir/build.make:130: recipe for target 'tools/compute_image_mean' failed
make[2]: *** [tools/compute_image_mean] Error 1
CMakeFiles/Makefile2:467: recipe for target 'tools/CMakeFiles/compute_image_mean.dir/all' failed
make[1]: *** [tools/CMakeFiles/compute_image_mean.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
这是的输出sudo ld lib/libcaffe.so.1.0.0
:
sudo ld lib/libcaffe.so.1.0.0
ld: warning: cannot find entry symbol _start; defaulting to 000101ec
lib/libcaffe.so.1.0.0: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
lib/libcaffe.so.1.0.0: undefined reference to `cv::imread(std::string const&, int)'
lib/libcaffe.so.1.0.0: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
lib/libcaffe.so.1.0.0: undefined reference to `cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
lib/libcaffe.so.1.0.0: undefined reference to `leveldb::Status::ToString() const'
根据ldd lib/libcaffe.so.1.0.0
,已找到所有必需的库。如何识别问题?
解决方案
推荐阅读
- html - 框在新页面中
- python - 替换数据框中的字符串时 Pandas 中的 SettingWithCopyWarning
- python - 如果没有明确的根包或模块,如何从 pytest 访问方法
- django - m2m_changed 信号多对多直通 - 保存
- python - 是否有一个 Python 库函数,给定一个字符串,将生成任何长度的所有排列,并重复?
- javascript - Angular FirebaseError 缺少或权限不足
- three.js - 单个cubeCamera 只反射非反射材料
- sql-server - 使用参数化查询更新链接服务器上的 varchar 列会导致远程扫描和游标获取
- assembly - fs:0x30 在 Linux 中提供了什么?
- python - 有没有办法堆叠小部件并忽略重叠?