14

I wrote a porgram with a few standard dialogs in an SDI (Doc/View enabled) project.

Now that I want to send it to some friends i did set the Use of MFC Use MFC in a static library.

But when i try to build the solution i get the following error:

error LNK2001: unresolved external symbol _IID_IWICImagingFactory

My problem is, that i don´t know what exactly this interface id is, because i did not write any code for COM manually or using any image factory things or equal...

Im a bit lost atm...

May anyone tell me how to solve this and make it work with the static MFC usage?

Thanks in advance!

Juarrow
  • 2,232
  • 5
  • 42
  • 61
  • 10
    Hard to guess what this linker error might have to do with MFC. Nevertheless, Project + Properties, Linker, Input. Additional Dependencies, add "windowscodecs.lib" – Hans Passant Nov 08 '11 at 00:40
  • See a related discussion here: http://social.msdn.microsoft.com/Forums/vstudio/en-US/c9827214-c2d9-4261-a384-5b183917bf97/after-installing-vs-2010-sp1-im-getting-nafxcwdlibafxglobalsobj-error-lnk2001-unresolved – Rami A. Sep 12 '13 at 20:29

3 Answers3

29

There is also a .lib file:

C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\ windowscodecs.lib

caesarvanou
  • 311
  • 2
  • 3
2

IWICImagingFactory is defined in wincodec.idl

  • Locate and add wincodec.idl to your MFC project
  • Rebuild and MIDL compiler will generate wincodec_i.c and wincodec_i.h
  • wincodec_i.* files contain the declaration and definition of _IID_IWICImagingFactory
parapura rajkumar
  • 24,045
  • 1
  • 55
  • 85
0

This wasn't my exact problem (different .idl), but same linker error. Google found your question anyway. I copied the .idl file out to a new directory, launched a VS command line, and ran this:

midl thefile.idl

After it made my .c file, I just copied the const for the IID that I needed, and threw away the rest.

Lynn Crumbling
  • 12,985
  • 8
  • 57
  • 95