AI智能
改变未来

安装Pangolin填过的坑啊啊啊啊啊啊啊~

mmp,心里真的是一万只cnm飘过,好心累

  • 1.安装时遇到的第一个问题
  • 2. 解决方法
  • 3.新的问题又来了
  • 4.终结方法

1.安装时遇到的第一个问题

上问题代码:

/usr/bin/ld: warning: libopencv_core.so.2.4, needed by //usr/lib/x86_64-linux-gnu/libavfilter-ffmpeg.so.5, not found (try using -rpath or -rpath-link)/usr/bin/ld: warning: libopencv_imgproc.so.2.4, needed by //usr/lib/x86_64-linux-gnu/libavfilter-ffmpeg.so.5, not found (try using -rpath or -rpath-link)//usr/lib/x86_64-linux-gnu/libavfilter-ffmpeg.so.5: undefined reference to `cvSmooth\'//usr/lib/x86_64-linux-gnu/libavfilter-ffmpeg.so.5: undefined reference to `cvErode\'//usr/lib/x86_64-linux-gnu/libavfilter-ffmpeg.so.5: undefined reference to `cvReleaseStructuringElement\'//usr/lib/x86_64-linux-gnu/libavfilter-ffmpeg.so.5: undefined reference to `cvCreateStructuringElementEx\'//usr/lib/x86_64-linux-gnu/libavfilter-ffmpeg.so.5: undefined reference to `cvCreateImageHeader\'//usr/lib/x86_64-linux-gnu/libavfilter-ffmpeg.so.5: undefined reference to `cvDilate\'collect2: error: ld returned 1 exit statustools/VideoViewer/CMakeFiles/VideoViewer.dir/build.make:122: recipe for target \'tools/VideoViewer/VideoViewer\' failedmake[2]: *** [tools/VideoViewer/VideoViewer] Error 1CMakeFiles/Makefile2:289: recipe for target \'tools/VideoViewer/CMakeFiles/VideoViewer.dir/all\' failedmake[1]: *** [tools/VideoViewer/CMakeFiles/VideoViewer.dir/all] Error 2Makefile:149: recipe for target \'all\' failedmake: *** [all] Error 2

各位老铁也一定百度了不少,也看得懂这个问题出在哪
问题就处在ffmpeg不兼容,可能是版本原因

2. 解决方法

卸载ffmpeg

sudo apt-get purge ffmpeg

卸载后在官网上手动下载:http://ffmpeg.org/releases/ffmpeg-4.3.tar.xz
再解压、安装。

3.新的问题又来了

当再重新进入pangolin/bulid/中编译make时,又出现错误如下:

src/CMakeFiles/pangolin.dir/build.make:662: recipe for target \'src/CMakeFiles/pangolin.dir/video/video_output.cpp.o\' failedmake[2]: *** [src/CMakeFiles/pangolin.dir/video/video_output.cpp.o] Error 1make[2]: *** Waiting for unfinished jobs....src/CMakeFiles/pangolin.dir/build.make:638: recipe for target \'src/CMakeFiles/pangolin.dir/video/video.cpp.o\' failedmake[2]: *** [src/CMakeFiles/pangolin.dir/video/video.cpp.o] Error 1CMakeFiles/Makefile2:135: recipe for target \'src/CMakeFiles/pangolin.dir/all\' failedmake[1]: *** [src/CMakeFiles/pangolin.dir/all] Error 2Makefile:127: recipe for target \'all\' failedmake: *** [all] Error 2

还是找啊找
最后还是看到博客:Ubuntu 14.04下安装Pagolin遇到的问题及解决方法(之一)中的方法才成功安装。

4.终结方法

到Pagolin/src文件夹下,在CMakeList.txt中删去下面这段代码(屏蔽掉ffmpeg的影响):

find_package(FFMPEG QUIET)if(BUILD_PANGOLIN_VIDEO AND FFMPEG_FOUND)set(HAVE_FFMPEG 1)list(APPEND INTERNAL_INC  ${FFMPEG_INCLUDE_DIRS} )list(APPEND LINK_LIBS ${FFMPEG_LIBRARIES} )list(APPEND HEADERS ${INCDIR}/video/drivers/ffmpeg.h)list(APPEND SOURCES video/drivers/ffmpeg.cpp)list(APPEND VIDEO_FACTORY_REG RegisterFfmpegVideoFactory )list(APPEND VIDEO_FACTORY_REG RegisterFfmpegVideoOutputFactory )if(_GCC_)# FFMPEG is a real pain for deprecating the API.set_source_files_properties(video/drivers/ffmpeg.cpp    PROPERTIES COMPILE_FLAGS \"-Wno-deprecated-declarations\")endif()message(STATUS \"ffmpeg Found and Enabled\")endif()

【可能原因】ffmpeg库和Pagolin版本之间可能存在冲突。本文的解决办法,以及其他可能的解决方法(如修改Pagolin的部分代码)和原因请参见下面这个帖子:

https://github.com/stevenlovegrove/Pangolin/issues/27

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » 安装Pangolin填过的坑啊啊啊啊啊啊啊~