Reputation: 384
I was trying to encode an image using WIC. and i made simple dll (to encode/decode) and reffered it from another aplication.
I added my_bitmap_converter()
to do a convertion intended to use WICConvertBitmapSource()
but it gives me a link error. here is my work
int my_bitmap_converter
(
REFWICPixelFormatGUID dstPixelFormt,
IWICBitmapSource* piBitmapSource,
IWICBitmapSource** ppiBitmapDst
)
{
IWICBitmapSource* piScr = piBitmapSource;
IWICBitmapSource** ppiDst = ppiBitmapDst;
hr = WICConvertBitmapSource
(
dstPixelFormt,//GUID_WICPixelFormat128bppPRGBAFloat,
piScr,
ppiDst
);
if (SUCCEEDED(hr))
{
piScr->Release();
return 0;
}
return -1;
}
how can i get rid of this error
Error 1 error LNK2019: unresolved external symbol _WICConvertBitmapSource@12 referenced in function "int __cdecl my_bitmap_converter(struct _GUID const &,struct IWICBitmapSource *,struct IWICBitmapSource * *)" (?my_bitmap_converter@@YAHABU_GUID@@PAUIWICBitmapSource@@PAPAU2@@Z)
---wincodec.h---
HRESULT WINAPI WICConvertBitmapSource(
_In_ REFWICPixelFormatGUID dstFormat, // Destination pixel format
_In_reads_(1) IWICBitmapSource *pISrc, // Source bitmap
_Outptr_result_buffer_(1) IWICBitmapSource **ppIDst // Destination bitmap, a copy or addrefed source
);
Upvotes: 2
Views: 827