NoteDeep
1.解压pangolin的压缩文件

2.mkdir build

3.cd build

4.cmake -DCPP11_NO_BOOST=1 ..

5.make -j后报错

error: ‘PixelFormat’ does not name a type; did you mean ‘AVPixelFormat’?
PixelFormat fmtout;
^~~~~~~~~~~
AVPixelFormat
/home/qin/slam14/3rdparty/Pangolin/include/pangolin/video/drivers/ffmpeg.h:142:5: error: ‘PixelFormat’ does not name a type; did you mean ‘AVPixelFormat’?
PixelFormat fmtsrc;
^~~~~~~~~~~
AVPixelFormat
/home/qin/slam14/3rdparty/Pangolin/include/pangolin/video/drivers/ffmpeg.h:143:5: error: ‘PixelFormat’ does not name a type; did you mean ‘AVPixelFormat’?
PixelFormat fmtdst;
^~~~~~~~~~~
AVPixelFormat

6.在pangolin/src文件夹下,找到CMakeLists.txt文件,打开,并在266行将以下代码注释。

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)
message(STATUS "ffmpeg Found and Enabled")
endif()
7.删除之前的build下的文件,重新cmake -DCPP11_NO_BOOST=1 .. make-j即可正常使用

评论列表