Jump to content
  • Advertisement
Sign in to follow this  
GuitarPlayer0912

TransparentBlt problem

This topic is 4867 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using dev c++ and am fairly new to windows programming. I am using the TransparentBlt() function to draw bitmaps to the screen using a transparent color for the background. When I compile the project, it works fine, but I get a linker error that says something like: [Linker error] undefined reference to '_ZN6Bitmap14TransparentBltEP5HDC__...blah blah blah. I think this has something to do with the fact that microsoft declares TransparentBlt() in the msimg32.lib library, but libmsimg32.a (dev c++ "equivalent") is not the same thing. So I need someone to tell me how to get TransparentBlt() to work (in ENGLISH please!) or how to include msimg32.lib into my project. Thank you!

Share this post


Link to post
Share on other sites
Advertisement
libmsimg32.a does contain the necessary code for you to use TransparentBlt(). Unfortunately I'm not familiar with Dev-C++ (real men use MinGW32/GCC from the command line, or Makefiles when they have to...;), but it'll probably involve either a) adding "-lmsimg32" to something called "Linker Options" or b) adding "msimg32" to something called "Link Libraries" or c) something else like that. Or try "libmsimg32.a". Whatever the case, it has to be associated with the linking stage of the project.

Share this post


Link to post
Share on other sites
Not sure if this is related, but I had problems with AlphaBlend(), until I found that you had to #define the correct _WIN32_WINNT and WINVER versions (> 0x0500) for certain more advanced GDI functions to be included.

Share this post


Link to post
Share on other sites
Since the error is a linker error, the compiler was able to find the necessary function prototype in the header, so the includes seem to be working properly.

Share this post


Link to post
Share on other sites
It looks like the compiler is treating TransparentBlt as a C++ function instead of a C function. You need to wrap whatever header you include to get it in extern "C". e.g:

extern "C"
{
#include <whatever has TransparentBlt in it>
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!