avp icon indicating copy to clipboard operation
avp copied to clipboard

can't build on fedora

Open SingingBush opened this issue 6 years ago • 3 comments

Fedora 29 cmake 3.12.1

cmake runs fine with cmake -DCMAKE_BUILD_TYPE=Release -DAVP_BUILD_TYPE=DESKTOP .. but then when I run make it has an issue with the include for libraries that are part of ffmpeg:

$ make
Scanning dependencies of target avp
[  0%] Building C object CMakeFiles/avp.dir/src/bink.c.o
~/CLionProjects/avp-master/src/bink.c:12:9: note: #pragma message: The includes for these are in ffmpeg
 #pragma message("The includes for these are in ffmpeg")
         ^~~~~~~
~/CLionProjects/avp-master/src/bink.c:13:10: fatal error: libavcodec/avcodec.h: No such file or directory
 #include "libavcodec/avcodec.h"
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/avp.dir/build.make:63: CMakeFiles/avp.dir/src/bink.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/avp.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

but I have them on my system under /usr/include/ffmpeg/

SingingBush avatar Dec 28 '18 22:12 SingingBush

Can you install libav, instead of ffmpeg? In fact, I don't know how libav is installed in Fedora (I'm using Arch/Ubuntu), but you should have the header files in /usr/include/libavcodec/

neuromancer avatar Dec 28 '18 23:12 neuromancer

to get libavcodec and other related stuff on Fedora you'd need to add the RPMfusion repository then sudo dnf install -y ffmpeg-devel which would give:

/usr/include/ffmpeg/libavcodec/ /usr/include/ffmpeg/libavdevice/ /usr/include/ffmpeg/libavfilter/ /usr/include/ffmpeg/libavformat/ /usr/include/ffmpeg/libavresample/ /usr/include/ffmpeg/libavutil/ /usr/include/ffmpeg/libpostproc/ /usr/include/ffmpeg/libswresample/ /usr/include/ffmpeg/libswscale/

I tried tweaking the find_component macro in CMakeFFmpegLibavMacros.cmake to get it working but didn't get it to work.

SingingBush avatar Dec 29 '18 01:12 SingingBush

It is because the headers are inside /usr/include/ffmpeg, you could patch the CMakeLists.txt to include that path

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ae2a49..83ff5b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,8 @@ ENDIF(AVP_BUILD_TYPE STREQUAL "WEB")
 
 PROJECT(avp)
 
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/include/ffmpeg")

runlevel5 avatar Aug 01 '20 17:08 runlevel5