参考Ubuntu20.04安装配置运行DynaSLAM_ubuntu20.04安装dyna-slam-CSDN博客配置
安装OpenCV3.2踩坑
参考ubuntu18.04安装openCV3.2.0详解(附加源码+第三方库)_ubuntu 18.04 opencv3.2-CSDN博客
常见问题:ubuntu20.04 安装 opencv3.2 编译问题解决_‘codec_flag_global_header’ was not declared in thi-CSDN博客
遇到个特别的:
[ 26%] Linking CXX executable ../../bin/opencv_visualisation /usr/bin/ld: ../../lib/libopencv_core.so.3.2.0: undefined reference to `cblas_sgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, float, float const*, int, float const*, int, float, float*, int)' /usr/bin/ld: ../../lib/libopencv_core.so.3.2.0: undefined reference to `cblas_zgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, void const*, void const*, int, void const*, int, void const*, void*, int)' /usr/bin/ld: ../../lib/libopencv_core.so.3.2.0: undefined reference to `cblas_dgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, double, double const*, int, double const*, int, double, double*, int)' /usr/bin/ld: ../../lib/libopencv_core.so.3.2.0: undefined reference to `cblas_cgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, void const*, void const*, int, void const*, int, void const*, void*, int)' collect2: error: ld returned 1 exit status make[2]: *** [apps/visualisation/CMakeFiles/opencv_visualisation.dir/build.make:96:bin/opencv_visualisation] 错误 1 make[1]: *** [CMakeFiles/Makefile2:3797:apps/visualisation/CMakeFiles/opencv_visualisation.dir/all] 错误 2 make: *** [Makefile:163:all] 错误 2
解决:这个错误表明链接器(ld)无法找到对应的符号引用,即 cblas_sgemm
、cblas_zgemm
、cblas_dgemm
和 cblas_cgemm
。这些符号通常与 BLAS(Basic Linear Algebra Subprograms)库相关联,而 BLAS 库通常用于线性代数计算。
运行
sudo apt-get install libopenblas-dev
解决!