[Libav-user] undefined reference to av_frame_alloc/free

Jason Blum jason.j.blum at gmail.com
Fri May 30 14:29:25 CEST 2014

> >  Do I need to create a ffmpeg package finding module .cmake file to make
> the .so full path appear?

Yes, it turns out you do need to use a cmake package finding module. The
full explanation:

Found the answer in some loosely related topics. I can't explain WHY this
works, but it does.

You need to use a package finding .cmake module for ffmpeg. You can find
one here:


After the find_package( ) for catkin, set the CMAKE_MODULE_PATH variable to
where you put the FindFFMPEG.cmake file, assuming your project is


Then use find_package on FFMPEG:


The FindFFMPEG.cmake file sets the FFMPEG_LIBRARIES variable:


Setting the CMAKE_MODULE_PATH messes up the whatever directory cmake thinks
it's in, so you need to specify absolute paths when you use add_executable(
), assuming your package is "ardrone_2":


Then link using that variable:

target_link_libraries(h264_decoder_node ${catkin_LIBRARIES}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20140530/7ee71227/attachment.html>

More information about the Libav-user mailing list