[FFmpeg-devel] (MSVC++) warning LNK4248: unresolved typeref token (01000015) for 'AVDictionary'; image may not run

Matthew Einhorn moiein2000 at gmail.com
Thu Feb 23 07:58:07 CET 2012


On Thu, Feb 23, 2012 at 1:44 AM, Reimar Döffinger
<Reimar.Doeffinger at gmx.de>wrote:

> On 22 Feb 2012, at 21:52, Matthew Einhorn <moiein2000 at gmail.com> wrote:
> > On Wed, Feb 22, 2012 at 3:19 PM, John Dexter <jdxsolutions at gmail.com>
> wrote:
> >
> >> I've just got ffmpeg working through MSVC++ 2008 using prebuilt libs,
> >> everything seems to be working in my test project but I get this one
> >> linker error and have no idea if it's a problem.
> >>
> >> Is this normal, should I worry, etc?
> >>
> >> warning LNK4248: unresolved typeref token (01000015) for
> >> 'AVDictionary'; image may not run
> >>
>
> Since it is a warning it is not a linker error.
>
> > Without seeing source I can not be sure. But I suspect the problem arises
> > because AVDictionary is not actually defined (other than a declaration)
> in
> > the include files included with the dll dist.
> > If you look in dict.h you'll see only this: "typedef struct AVDictionary
> > AVDictionary;"
> >
> > So, somewhere in your include files actually define AVDictionary as such:
> >
> > //common.h
> > struct AVDictionary {
> >    int count;
> >    AVDictionaryEntry *elems;
> > };
>
> If you do that your code an break at any time with any FFmpeg update.
> We make no promises on the internal format of the AVDictionary struct.
> I haven't been able to understand what the MSDN description of the warning
> is trying to say, but it sounds like it's an issue with CLR (i.e. managed
> code) interoperability.
> In that case you just should make sure to not use that type from managed
> code (that probably actually applies to all FFmpeg types, e.g. you are not
> allowed to make assumptions on the size of AVCodecContext, but the managed
> code interop most likely will).
>

Well, according to http://www.dotnet247.com/247reference/msgs/1/7811.aspxdoing
//common.h
struct AVDictionary {};

is enough (assuming it's the same problem).

Compiling in native c++ in vs2010 doesn't generate this error for me.

Matt


More information about the ffmpeg-devel mailing list