文章目录
- 1.编译错误
- 1.1 错误1
- 1.2 错误2
- 1.3 错误3
- 1.4 错误4
1.编译错误
首先ORB-SLAM相关项目已经写过很多篇博客了,从ORB-SLAM2怎么运行,再到现在的项目。关于环境已经不想多说了
1.1 错误1
– DEPENDENCY_LIBS : /home/lvslam/ORB3-YOLO8/Thirdparty/fastdeploy-linux-x64-1.0.3/lib/libfastdeploy.so;/home/lvslam/ORB3-YOLO8/Thirdparty/fastdeploy-linux-x64-1.0.3/third_libs/install/onnxruntime/lib/libonnxruntime.so;/home/lvslam/ORB3-YOLO8/Thirdparty/fastdeploy-linux-x64-1.0.3/third_libs/install/paddle_inference/paddle/lib/libpaddle_inference.so;/home/lvslam/ORB3-YOLO8/Thirdparty/fastdeploy-linux-x64-1.0.4/third_libs/install/paddle_inference/third_party/install/mkldnn/lib/libmkldnn.so.0;/home/lvslam/ORB3-YOLO8/Thirdparty/fastdeploy-linux-x64-1.0.4/third_libs/install/paddle_inference/third_party/install/mklml/lib/libiomp5.so;/home/lvslam/ORB3-YOLO8/Thirdparty/fastdeploy-linux-x64-1.0.3/third_libs/install/openvino/runtime/lib/libopenvino.so;TBB::tbb;TBB::tbbmalloc;TBB::tbbmalloc_proxy;opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio;opencv_shape;opencv_superres;opencv_videostab;/home/lvslam/ORB3-YOLO8/Thirdparty/fastdeploy-linux-x64-1.0.3/third_libs/install/fast_tokenizer/lib/libcore_tokenizers.so;/home/lvslam/ORB3-YOLO8/Thirdparty/fastdeploy-linux-x64-1.0.3/third_libs/install/paddle2onnx/lib/libpaddle2onnx.so
– BUILD TYPE:Release
– Compiling on Unix
– Configuring done
– Generating done
– Build files have been written to: /home/lvslam/ORB3-YOLO8/build [ 50%] Built target g2o make[2]: ***
没有规则可制作目标“…/Thirdparty/fastdeploy-linux-x64-1.0.3/lib/libfastdeploy.so”,由“…/lib/libORB_SLAM3.so”
需求。 停止。 make[1]: ***
[CMakeFiles/Makefile2:126:CMakeFiles/ORB_SLAM3.dir/all] 错误 2 make: ***
[Makefile:84:all] 错误 2
这个项目的博主没有说应该用哪个版本的fastdeploy-linux-x64-1.0.3,我就先下载了fastdeploy-linux-x64-1.0.3版本,但是编译不过去
经过测试换成fastdeploy-linux-x64-1.0.4即可!
1.2 错误2
[100%] Linking CXX executable …/Examples/RGB-D/rgbd_tum /usr/bin/ld:
warning: libopencv_video.so.3.4, needed by
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so, not
found (try using -rpath or -rpath-link) /usr/bin/ld: warning:
libopencv_highgui.so.3.4, needed by
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so, not
found (try using -rpath or -rpath-link) /usr/bin/ld: warning:
libopencv_videoio.so.3.4, needed by
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so, not
found (try using -rpath or -rpath-link) /usr/bin/ld: warning:
libopencv_imgcodecs.so.3.4, needed by
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so, not
found (try using -rpath or -rpath-link) /usr/bin/ld: warning:
libopencv_imgproc.so.3.4, needed by
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so, not
found (try using -rpath or -rpath-link) /usr/bin/ld: warning:
libopencv_core.so.3.4, needed by
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so, not
found (try using -rpath or -rpath-link) /usr/bin/ld:
CMakeFiles/rgbd_tum.dir/Examples/RGB-D/rgbd_tum.cc.o: in function
CpuInfer(std::__cxx11::basic_string<char, std::char_traits,
std::allocator > const&, std::__cxx11::basic_string<char,
std::char_traits, std::allocator >,
fastdeploy::vision::DetectionResult*)‘: rgbd_tum.cc:(.text+0xd93):
undefined reference to cv::imread(cv::String const&, int)’
/usr/bin/ld: rgbd_tum.cc:(.text+0xd9b): undefined reference to
cv::String::deallocate()’ /usr/bin/ld: rgbd_tum.cc:(.text+0x104a):
undefined reference to cv::String::allocate(unsigned long)’
/usr/bin/ld: CMakeFiles/rgbd_tum.dir/Examples/RGB-D/rgbd_tum.cc.o: in
function GpuInfer(std::__cxx11::basic_string<char,
std::char_traits, std::allocator > const&,
std::__cxx11::basic_string<char, std::char_traits,
std::allocator >, fastdeploy::vision::DetectionResult*)‘:
rgbd_tum.cc:(.text+0x153f): undefined reference to
cv::imread(cv::String const&, int)’ /usr/bin/ld:
rgbd_tum.cc:(.text+0x1547): undefined reference to
cv::String::deallocate()’ /usr/bin/ld: rgbd_tum.cc:(.text+0x17fa):
undefined reference to cv::String::allocate(unsigned long)’
/usr/bin/ld: CMakeFiles/rgbd_tum.dir/Examples/RGB-D/rgbd_tum.cc.o: in
function TrtInfer(std::__cxx11::basic_string<char,
std::char_traits, std::allocator > const&,
std::__cxx11::basic_string<char, std::char_traits,
std::allocator >, fastdeploy::vision::DetectionResult*)‘:
rgbd_tum.cc:(.text+0x1df5): undefined reference to
cv::imread(cv::String const&, int)’ /usr/bin/ld:
rgbd_tum.cc:(.text+0x1dfd): undefined reference to
cv::String::deallocate()’ /usr/bin/ld: rgbd_tum.cc:(.text+0x20ea):
undefined reference to cv::String::allocate(unsigned long)’
/usr/bin/ld: CMakeFiles/rgbd_tum.dir/Examples/RGB-D/rgbd_tum.cc.o: in
function CpuInfer(std::__cxx11::basic_string<char,
std::char_traits, std::allocator > const&,
std::__cxx11::basic_string<char, std::char_traits,
std::allocator >, fastdeploy::vision::DetectionResult*) [clone
.cold]‘: rgbd_tum.cc:(.text.unlikely+0x35d): undefined reference to
cv::String::deallocate()’ /usr/bin/ld:
CMakeFiles/rgbd_tum.dir/Examples/RGB-D/rgbd_tum.cc.o: in function
GpuInfer(std::_cxx11::basic_string<char, std::char_traits,
std::allocator > const&, std::cxx11::basic_string<char,
std::char_traits, std::allocator >,
fastdeploy::vision::DetectionResult*) [clone .cold]‘:
rgbd_tum.cc:(.text.unlikely+0x3b7): undefined reference to
cv::String::deallocate()’ /usr/bin/ld:
CMakeFiles/rgbd_tum.dir/Examples/RGB-D/rgbd_tum.cc.o: in function
TrtInfer(std::cxx11::basic_string<char, std::char_traits,
std::allocator > const&, std::cxx11::basic_string<char,
std::char_traits, std::allocator >,
fastdeploy::vision::DetectionResult*) [clone .cold]‘:
rgbd_tum.cc:(.text.unlikely+0x402): undefined reference to
cv::String::deallocate()’ /usr/bin/ld:
CMakeFiles/rgbd_tum.dir/Examples/RGB-D/rgbd_tum.cc.o: in function
main.cold’: rgbd_tum.cc:(.text.unlikely+0x5d1): undefined reference to
cv::String::deallocate()’ /usr/bin/ld:
rgbd_tum.cc:(.text.unlikely+0x628): undefined reference to
cv::String::deallocate()’ /usr/bin/ld:
CMakeFiles/rgbd_tum.dir/Examples/RGB-D/rgbd_tum.cc.o: in function
main’: rgbd_tum.cc:(.text.startup+0xc42): undefined reference to
cv::Mat::Mat()’ /usr/bin/ld: rgbd_tum.cc:(.text.startup+0xc4e):
undefined reference to cv::Mat::Mat()’ /usr/bin/ld:
rgbd_tum.cc:(.text.startup+0xe7c): undefined reference to
cv::imread(cv::String const&, int)’ /usr/bin/ld:
rgbd_tum.cc:(.text.startup+0xf55): undefined reference to
cv::String::deallocate()’ /usr/bin/ld:
rgbd_tum.cc:(.text.startup+0x1121): undefined reference to
cv::imread(cv::String const&, int)’ /usr/bin/ld:
rgbd_tum.cc:(.text.startup+0x120a): undefined reference to
cv::String::deallocate()’ /usr/bin/ld:
rgbd_tum.cc:(.text.startup+0x1e13): undefined reference to
cv::String::allocate(unsigned long)’ /usr/bin/ld:
rgbd_tum.cc:(.text.startup+0x1eb2): undefined reference to
cv::String::allocate(unsigned long)’ /usr/bin/ld:
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so:
undefined reference to cv::InputArray::InputArray(cv::MatExpr
const&)’ /usr/bin/ld: …/lib/libORB_SLAM3.so: undefined reference to
cv::getTextSize(cv::String const&, int, double, int, int*)’
/usr/bin/ld:
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so:
undefined reference to cv::rectangle(cv::Mat&, cv::Rect,
cv::Scalar const&, int, int, int)’ /usr/bin/ld:
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so:
undefined reference to cv::findContours(cv::InputOutputArray const&,
cv::OutputArray const&, cv::OutputArray const&, int, int,
cv::Point)’ /usr/bin/ld: …/lib/libORB_SLAM3.so: undefined
reference to cv::Mat::Mat(int, int, int)’ /usr/bin/ld:
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so:
undefined reference to cv::fillPoly(cv::Mat&, cv::Point const**,
int const*, int, cv::Scalar const&, int, int,
cv::Point)’ /usr/bin/ld:
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so:
undefined reference to cv::KalmanFilter::predict(cv::Mat const&)’
/usr/bin/ld:
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so:
undefined reference to cv::KalmanFilter::correct(cv::Mat const&)’
/usr/bin/ld: …/lib/libORB_SLAM3.so: undefined reference to
cv::read(cv::FileNode const&, cv::String&, cv::String const&)’
/usr/bin/ld: …/lib/libORB_SLAM3.so: undefined reference to
cv::putText(cv::InputOutputArray const&, cv::String const&,
cv::Point, int, double, cv::Scalar, int, int, bool)’
/usr/bin/ld: …/lib/libORB_SLAM3.so: undefined reference to
cv::OutputArray::create(int, int, int, int, bool, int) const’
/usr/bin/ld: …/lib/libORB_SLAM3.so: undefined reference to
cv::namedWindow(cv::String const&, int)’ /usr/bin/ld:
…/lib/libORB_SLAM3.so: undefined reference to
cv::write(cv::FileStorage&, cv::String const&, int)’ /usr/bin/ld:
…/lib/libORB_SLAM3.so: undefined reference to
cv::FileStorage::operator[](cv::String const&) const’ /usr/bin/ld:
…/lib/libORB_SLAM3.so: undefined reference to cv::Mat::Mat(int, int,
int, cv::Scalar const&)’ /usr/bin/ld:
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so:
undefined reference to cv::getPerspectiveTransform(cv::Point
const*, cv::Point const*)’ /usr/bin/ld:
…/lib/libORB_SLAM3.so: undefined reference to cv::error(int,
cv::String const&, char const*, char const*, int)’ /usr/bin/ld:
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so:
undefined reference to cv::KalmanFilter::KalmanFilter(int, int, int,
int)’ /usr/bin/ld: …/lib/libORB_SLAM3.so: undefined reference to
cv::operator<<(cv::FileStorage&, cv::String const&)’ /usr/bin/ld:
…/lib/libORB_SLAM3.so: undefined reference to cv::Mat::Mat()’
/usr/bin/ld: …/lib/libORB_SLAM3.so: undefined reference to
cv::Formatter::get(int)’ /usr/bin/ld: …/lib/libORB_SLAM3.so:
undefined reference to cv::write(cv::FileStorage&, cv::String const&,
double)’ /usr/bin/ld: …/lib/libORB_SLAM3.so: undefined reference to
cv::FileStorage::FileStorage(cv::String const&, int, cv::String
const&)’ /usr/bin/ld: …/lib/libORB_SLAM3.so: undefined reference to
cv::Mat::Mat(int, int, int)’ /usr/bin/ld: …/lib/libORB_SLAM3.so:
undefined reference to cv::Mat::Mat(cv::Size, int)’ /usr/bin/ld:
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so:
undefined reference to cv::polylines(cv::Mat&, cv::Point const*
const*, int const*, int, bool, cv::Scalar const&, int, int,
int)’ /usr/bin/ld: …/lib/libORB_SLAM3.so: undefined reference to
cv::Mat::total() const’ /usr/bin/ld: …/lib/libORB_SLAM3.so: undefined
reference to cv::Mat::step1(int) const’ /usr/bin/ld:
…/lib/libORB_SLAM3.so: undefined reference to cv::imshow(cv::String
const&, cv::_InputArray const&)’ /usr/bin/ld:
…/Thirdparty/fastdeploy-linux-x64-1.0.4/lib/libfastdeploy.so:
undefined reference to cv::imwrite(cv::String const&, cv::_InputArray
const&, std::vector<int, std::allocator > const&)’ collect2:
error: ld returned 1 exit status make[2]: ***
[CMakeFiles/rgbd_tum.dir/build.make:133:…/Examples/RGB-D/rgbd_tum] 错误
1 make[1]: *** [CMakeFiles/Makefile2:99:CMakeFiles/rgbd_tum.dir/all]
错误 2 make: *** [Makefile:84:all] 错误 2
因为跑上一个项目我用的是OpenCv4.2的版本,所以更新了一些库,这里造成部分库缺失
所以只需要将OpenCv换成3.4.5版本即可,但是重新卸载OpenCv太过麻烦,所以我们可以安装多个版本的OpenCv。
跑不同项目切换不同版本即可!!
链接: OpenCv多版本共存的安装路径与切换使用
还要注意CMakeLists中的版本!!
1.3 错误3
./Examples/RGB-D/rgbd_tum: error while loading shared libraries: libonnxruntime.so.1.12.0: cannot open shared object file: No such file or directory
解决方法:
执行 source /path/to/fastdeploy-linux-xxx/fastdeploy_init.sh
source /home/lvslam/ORB3-YOLO8/Thirdparty/fastdeploy-linux-x64-1.0.4/fastdeploy_init.sh
1.4 错误4
执行命令
./Examples/RGB-D/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUM1.yaml /home/lvslam/ORB3-YOLO8/evaluation/rgbd_dataset_freiburg3_walking_xyz /home/lvslam/ORB3-YOLO8/evaluation/rgbd_dataset_freiburg3_walking_xyz/associations.txt cpu
这是找不到文件,我们需要在当前目录下建立一个model文件夹,然后把yolov8n.onnx放进去就可以了!
至此我们就又成功复现一个项目!