You are here

error: ‘AVPacket’ has not been declared

2 posts / 0 new
Last post
rongyilin
rongyilin's picture
error: ‘AVPacket’ has not been declared

Hi, I tried to compile mrpt 0.95 on ubuntu lucid, but the following errors appreared. 

How to fix?

BTW, is the binaries on Ubuntu PPA repositories comipled with PCL?

==============================================================

In file included from /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:39: /usr/local/include/libavformat/avformat.h:196: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:212: error: ‘AVPacket’ has not been declared In file included from /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:39: /usr/local/include/libavformat/avformat.h:298: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:309: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:310: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:374: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:585: error: ‘AVPacket’ does not name a type In file included from /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:39: /usr/local/include/libavformat/avformat.h:873: error: ‘AVPacket’ does not name a type /usr/local/include/libavformat/avformat.h:923: error: use of enum ‘AVMediaType’ without previous declaration /usr/local/include/libavformat/avformat.h:958: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:972: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:976: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:977: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:1195: error: use of enum ‘AVMediaType’ without previous declaration /usr/local/include/libavformat/avformat.h:1211: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:1237: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:1480: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:1497: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:1514: error: ‘AVPacket’ has not been declared /usr/local/include/libavformat/avformat.h:1515: error: ‘AVPacket’ has not been declared /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp: In member function ‘bool mrpt::hwdrivers::CFFMPEG_InputStream::openURL(const std::string&, bool, bool)’: /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:148: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1090) /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:148: warning: ‘int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1090) /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:170: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1532) /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:170: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1532) /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp: In member function ‘bool mrpt::hwdrivers::CFFMPEG_InputStream::retrieveFrame(mrpt::utils::CImage&)’: /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:306: error: ‘AVPacket’ was not declared in this scope /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:306: error: expected ‘;’ before ‘packet’ /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:309: error: ‘packet’ was not declared in this scope /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:376: error: ‘av_free_packet’ was not declared in this scope /home/easy/Downloads/mrpt-0.9.5/libs/hwdrivers/src/CFFMPEG_InputStream.cpp:382: error: ‘av_free_packet’ was not declared in this scope make[2]: *** [libs/hwdrivers/CMakeFiles/mrpt-hwdrivers.dir/src/CFFMPEG_InputStream.cpp.o] Error 1 make[2]: Leaving directory `/home/easy/Downloads/mrpt-0.9.5/build' make[1]: *** [libs/hwdrivers/CMakeFiles/mrpt-hwdrivers.dir/all] Error 2 make[1]: Leaving directory `/home/easy/Downloads/mrpt-0.9.5/build'

================================================================

jlblanco
jlblanco's picture
Hi, That's because of an

Hi, 

That's because of an update in the ffmpeg libraries. The latest version of MRPT (from SVN trunk) fixes it. Try with that new version, or at least replace the .cpp file that fails. I'll soon release 0.9.6, but it may take at least 2-3 weeks but in the meanwhile there's no easier solution.

 

On PCL, nope, it's not included in PPA. But notice that you can use most of the MRPT-PCL integration by just including PCL headers in your code as well as including MRPT's. See this list: http://reference.mrpt.org/svn/dep-pcl.html and the examples of MRPT-PCL integration: http://mrpt.googlecode.com/svn/trunk/doc/mrpt-pcl-examples/

 

JL

Log in or register to post comments
Subscribe to Comments for "error: ‘AVPacket’ has not been declared"