[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Error linking libavcodec

From: Tony Theodore
Subject: Re: [Mingw-cross-env-list] Error linking libavcodec
Date: Tue, 9 Dec 2014 02:25:10 +1100

On 9 Dec 2014, at 01:59, Alex Zelid <address@hidden> wrote:

Using pkg-config is probably the easiest way:
> i686-w64-mingw32. static-gcc main.c -o main.exe `i686-w64-mingw32.static-pkg-config --libs --cflags libavcodec`

Thanks, Tony, that worked fine! 

Just wonder what was wrong with my approach? To don’t step on the same rake twice. 

Specifying libs manually is very hard to get right in the first place - harder to maintain. You have to get them in the right order:

your project --> deps --> deps of deps ... --> system libs 

and essentially flatten the dependency graph by hand. You were missing either/both "-lopencore-amrwb -lopencore-amrnb” (at least), ffmpeg has so many plugins and a new one may be enabled in the future that will break your build.

P.S. It's the first linking 3rd party GNU tool-chain libraries in C/C++ I saw MXE documentation mentions pkg-config but I've never used it before.

Using pkg-config takes care of both the dep graph and insulates you from future upstream changes - for packages that use it, we try to make sure it “just works”.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]