visual studio building error: unresolved external symbol _IID_IWICImagingFactory (MFC static lib)
-
23-02-2021 - |
سؤال
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!
المحلول
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
نصائح أخرى
There is also a .lib file:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\ windowscodecs.lib
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.