Dec 16, 2012 at 3:42am UTC
The type is irrelevant as long as it has those four members (the Windows structure RECT fits the bill). The rectangle specifies the destination rectangle.
Dec 16, 2012 at 3:53am UTC
This code gives the errors below it:
2 3 4 5 6 7 8 9 10 11 12
FIBITMAP *dib = FreeImage_Load(FIF_PNG,
StretchDIBits(hDC, rcDest.left, rcDest.top,
0, 0, FreeImage_GetWidth(dib), FreeImage_GetHeight(dib),
FreeImage_GetBits(dib), FreeImage_GetInfo(dib), DIB_RGB_COLORS, SRCCOPY);
2 3 4 5 6 7
obj\Release\main.o:main.cpp|| undefined reference to `_imp__FreeImage_Load@12
obj\Release\main.o:main.cpp|| undefined reference to `_imp__FreeImage_GetInfo@4'|
obj\Release\main.o:main.cpp|| undefined reference to `_imp__FreeImage_GetBits@4 '|
obj\Release\main.o:main.cpp|| undefined reference to `_imp__FreeImage_GetHeight@4'|
obj\Release\main.o:main.cpp|| undefined reference to `_imp__FreeImage_GetWidth@4 '|
obj\Release\main.o:main.cpp|| undefined reference to `_imp__FreeImage_Unload@4'|
||=== Build finished: 6 errors, 0 warnings (0 minutes, 1 seconds) ===|
Last edited on
Dec 16, 2012 at 3:54am UTC
Dec 16, 2012 at 6:23am UTC
These are linker errors, it means you have to add freeimage.lib or whatever is called to linker input.
Dec 16, 2012 at 3:29pm UTC
Where is "FreeImage.lib" included in the latest ZIP packaged source? Apparently I need to link to it. I'm using Code::Blocks 12.11 with MinGW.
Dec 16, 2012 at 3:37pm UTC
For MinGW is likely called "libfreeimage.a" or something like that. It is produced after you compile FreeImage from source code using the same compiler.
Dec 16, 2012 at 5:32pm UTC
I never used FreeImage or any image library in windows (you could load PNG images natively using GDI+ in windows, no library needed), but the idea is that you need to check return values from any functions you call and see where the problem is exactly.