/ usr / bin / ld在编译openCv matlab源代码时找不到lib文件

时间:2014-01-21 21:38:47

标签: matlab opencv ubuntu

尝试使用matlab模块编译openCV时出现以下错误。

我只是在我创建的现实文件夹中运行$ make,就像在tutorial from opencv.org

中一样
    [ 98%] Compiling Matlab source files. This could take a while...
    CMake Error at /home/alex/Downloads/opencv-master/modules/matlab/compile.cmake:47 (message):
    Failed to compile drawChessboardCorners: /usr/bin/ld: cannot find
      -lopencv_core

  /usr/bin/ld: cannot find -lopencv_imgproc

  (Removed alot of lines with lib files here)

  collect2: error: ld returned 1 exit status



      mex: link of ' "drawChessboardCorners.mexa64"' failed.

如何修复链接错误?它与matlab有关吗?

MATLAB 2013a Ubuntu 13.10

1 个答案:

答案 0 :(得分:0)

我认为这与MATLAB无关。 :

/usr/bin/ld: cannot find

可能指向链接器在编译期间找不到的opencv_core库的缺失路径。请参阅:usr/bin/ld: cannot find -l<nameOfTheLibrary>

如果您手动构建,可以添加-L选项,例如

-L<path_to_opencv_core>-lopencv_core

之前

-lopencv_imgproc

到命令行构建命令。如果您使用的是CMake文件,则可以设置${OPENCV_LIB_INSTALL_PATH}(或类似内容),例如,使用ccmake.