In my other linker options I have -llibmsimg32 listed, my directories are set. and I'm still get an error.
BTW, I'm using mingw. I can get this to work with VS2003 but I'd like to get it to work with Code::Blocks and mingw.
Bitmap.cpp: In member function `void Bitmap::Draw(HDC__*, int, int, BOOL, COLORREF)':
Bitmap.cpp:226: error: `TransparentBlt' undeclared (first use this function)
Bitmap.cpp:226: error: (Each undeclared identifier is reported only once for each function it appears in.)
Process terminated with status 1 (0 minutes, 20 seconds)
If you have any insights please...I would be in your debt
Thanks
drew
That's not a linking error. It can't find the function definition.
Browsing here, it tells you that you need the header file, Wingdi.h
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_2y9g.asp
If you defined #WIN32_LEAN_AND_MEAN, it may have not been including with windows.h, so just include it manually.
Thank you very much. I will give it a try.
Nope, didn't happen.
I switched it to just you BitBlt and -lmsimg32 does not look good at all.
It runs fine but I can not for the life of me get it to work with TransparentBlt. Works fine with VS2003.
Odd.
I remember somebody else posting about this on another board, I think Gamedev.net. I'll take a quick peek. But the library you link to has nothing to do with it. That is the correct library. The error you posted is not a linker error, it's a compiler error where it can't find the function definition.
It's supported only in Win98 and above. Did you define a windows version? Try searching for the function in WINGDI.h and see if it's only defined if you have WIN98 or greater defined as your windows version.
Actually, MS says you shouldn't use that function, and has an article on how to make transparent blits.
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B79212
I came across this and it talks about the order things are called up when linking in g++
http://sourceforge.net/forum/forum.php?thread_id=1305898&forum_id=286641
Well, I got it to work. I took the if statement out of wingid.h
#if (WINVER >= 0x0500)
BOOL WINAPI AlphaBlend(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION);
BOOL WINAPI GradientFill(HDC,PTRIVERTEX,ULONG,PVOID,ULONG,ULONG);
BOOL WINAPI TransparentBlt(HDC,int,int,int,int,HDC,int,int,int,int,UINT);
#endif
Haven't figured out why it isnt' reading the correct version of windows yet.
How about
#define WINVER 0x0500
Then I had problems with the linking. If figured out that too. Woohoo a good day.
Thanks
drew
Were you defining that WINVER value before including windows.h? Otherwise it'd be useless.
hi griend where you put this code in any .H or where salutes ;D
#if (WINVER >= 0x0500)
BOOL WINAPI AlphaBlend(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION);
BOOL WINAPI GradientFill(HDC,PTRIVERTEX,ULONG,PVOID,ULONG,ULONG);
BOOL WINAPI TransparentBlt(HDC,int,int,int,int,HDC,int,int,int,int,UINT);
#endif
Haven't figured out why it isnt' reading the correct version of windows yet.
How about
#define WINVER 0x0500
Then I had problems with the linking. If figured out that too. Woohoo a good day.
Thanks
drew
[/quote]