<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hello,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I am working on a catkin-built ROS c++ project. I am trying to link to whatever FFMPEG library is necessary to use the new av_frame_alloc( ) and av_frame_free( ) functions. The online documentation says it would be avutil/frame.h, but I still get undefined reference linking errors.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I am also linking to avcodec, avformat, and swscale, all of which seem to link just fine.</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">This is my ffmpeg version:</div><div style="font-family:arial,sans-serif;font-size:13px"><div>ffmpeg version 2.2.git Copyright (c) 2000-2014 the FFmpeg developers</div>
<div> built on May 2 2014 21:57:13 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)</div><div> configuration: --disable-stripping --enable-shared</div><div> libavutil 52. 66.101 / 52. 66.101</div><div> libavcodec 55. 52.102 / 55. 52.102</div>
<div> libavformat 55. 34.100 / 55. 34.100</div><div> libavdevice 55. 11.100 / 55. 11.100</div><div> libavfilter 4. 3.100 / 4. 3.100</div><div> libswscale 2. 5.101 / 2. 5.101</div><div> libswresample 0. 18.100 / 0. 18.100</div>
<div>Hyper fast Audio and Video encoder</div><div>usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
These are the compile errors:</div><div style="font-family:arial,sans-serif;font-size:13px"><div>CMakeFiles/h264_decoder_node.dir/src/h264_decoder.cpp.o: In function `h264_Decoder::h264_Decoder()':</div><div>h264_decoder.cpp:(.text+0x19c): undefined reference to `av_frame_alloc'</div>
<div>h264_decoder.cpp:(.text+0x1ac): undefined reference to `av_frame_alloc'</div><div>CMakeFiles/h264_decoder_node.dir/src/h264_decoder.cpp.o: In function `h264_Decoder::~h264_Decoder()':</div><div>h264_decoder.cpp:(.text+0x32e): undefined reference to `av_frame_free'</div>
<div>h264_decoder.cpp:(.text+0x340): undefined reference to `av_frame_free'</div><div>collect2: error: ld returned 1 exit status</div><div>make[2]: *** [/home/jason/ROS/ARDrone/devel/lib/ardrone_2/h264_decoder_node] Error 1</div>
<div>make[1]: *** [ardrone_2/CMakeFiles/h264_decoder_node.dir/all] Error 2</div><div>make: *** [all] Error 2</div><div>Invoking "make" failed</div></div><div style="font-family:arial,sans-serif;font-size:13px">
<br>
</div><div style="font-family:arial,sans-serif;font-size:13px">The headers I am #include'ing:</div><span style="font-family:arial,sans-serif;font-size:13px">extern "C" {</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> #include <libavcodec/avcodec.h></span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px"> #include <libswscale/swscale.h></span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> #include <libavformat/avformat.h></span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px"> #include <libavutil/avutil.h></span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px"> #include <libavutil/frame.h></span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">}</span><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">What am I missing?</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks,</div>
<div style="font-family:arial,sans-serif;font-size:13px">Jason</div></div>