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 <geo...@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-
> re5jqeeqqe8avxtiumw...@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@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
_______________________________________________
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to