[FFmpeg-user] Linking applications with FFmpeg

Misha Penkov misha.penkov at gmail.com
Thu Sep 20 14:02:18 CEST 2012


On 20 September 2012 20:33, Nicolas George
<nicolas.george at normalesup.org> wrote:
> Le jour de la Récompense, an CCXX, Misha Penkov a écrit :
>> mpenkov at misha-desktop:~/git/ffmpeg-tutorial$ make bin/tutorial01.out
>> gcc -Wall -ggdb `pkg-config --cflags libavcodec libavformat libavutil
>> libswscale sdl` -c tutorial01.c -o obj/tutorial01.o
>
> $(...) is recommended over `...`, but that is unrelated.

I didn't know that.  Thank you.

>> gcc -Wall -ggdb `pkg-config --cflags libavcodec libavformat libavutil
>> libswscale sdl` `pkg-config --cflags libavcodec libavformat libavutil
>> libswscale sdl` `pkg-config --libs libavcodec libavformat libavutil
>> libswscale sdl` -lm obj/tutorial01.o  -o bin/tutorial01.out
>
> Libraries should be added after object files, in dependency order. For
> shared libraries that does not matter much but for static libraries this is
> mandatory.

Thank you Nicholas.  This fixed the problem.

>
> Also, this command line seems too complex: you are requesting the cflags
> twice, for no reason since you are only linking.

You're right.  This is a bug in the Makefile.  I'll fix it.

Thanks again!
Michael

> Regards,
>
> --
>   Nicolas George
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAlBa/woACgkQsGPZlzblTJNiLQCfVmlbAB32VPE0e1HTpsvTBgEp
> 31wAn1J0fC64xZ8fWYm1Uw3f1UrhCXPg
> =gwpY
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user


More information about the ffmpeg-user mailing list