[Libav-user] How to compile dev from source

Peter Kroon plakroon at gmail.com
Tue Aug 8 14:27:55 EEST 2017


Hello,

AS mentiond in the first post I used this install guide for CentOS:
https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
I followed the path/steps written in the article.

First I've added --enable-shared to the configure command. This did not
gave the result I was looking for.
--disable-static and  --enable-shared were needed.
This allowed me to compile the program below with gcc -g test.c -o test -W
-Wall -Wextra -Werror -pedantic

=================================================================
#include <stdio.h>
#include <stdlib.h>
#include <libavutil/imgutils.h>
#include <libavutil/samplefmt.h>
#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>
int main()
{
 printf("The echo..n\");
 return 0;
}
=================================================================

However, when I added av_register_all(); the program would not compile.
To solve this I ran the code below in console.

=================================================================
C_INCLUDE_PATH=/root/ffmpeg_build/include
export C_INCLUDE_PATH
#debug
echo $C_INCLUDE_PATH
LIBRARY_PATH=/root/ffmpeg_build/lib
export LIBRARY_PATH
#debug
echo $LIBRARY_PATH
LD_LIBRARY_PATH=/root/ffmpeg_build/lib
export LD_LIBRARY_PATH
#debug
echo $LD_LIBRARY_PATH
=================================================================

Now add av_register_all(); above the printf and I was able to compile the
program with:
gcc -g test.c -o test -W -Wall -Wextra -Werror -pedantic -lavcodec
-lavformat -lavutil

And the example programs compiled as well.

2017-07-24 10:10 GMT+02:00 Nicolas George <george at nsup.org>:

> Le sextidi 6 thermidor, an CCXXV, Peter Kroon a écrit :
> > e.g. the program below will not compile
> >
> > // gcc -g test.c -o test -W -Wall -Wextra -Werror -pedantic -lavcodec
> > -lavformat -lavutil
>
> Without knowing how exactly you installed FFmpeg and the compiler's
> output, I can only guess that the paths for includes and libraries (-I
> and -L) are not correct.
>
> Also, I hope you realize that this command-line tells gcc to adhere to a
> language that was already obsolete in the last century.
>
> > 2017-07-24 9:16 GMT+02:00 Peter Kroon <plakroon-
> Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>:
>
> Please do not top-post on these mailing-lists. If you do not know what
> it means, look it up.
>
> Regards,
>
> --
>   Nicolas George
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170808/2639d1e4/attachment.html>


More information about the Libav-user mailing list