Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

[FreeImage] Utilities.h unresolved external if Windows.h is included above it.

$
0
0
Hi, I'm using the FreeImage library to load images into my game engine. However, I have a small problem. There is a header file called Utilities.h and it contains a function called SwapRedBlue32. My problem is that if I include Windows.h at the very top of my ImageLoader class and then include FreeImage headers after it I get an unresolved external error. The linker will not be able to link to the SwapRedBlue32 function. If I don't include Windows.h everything seems to work just fine. If I include Windows.h at the very bottom (after the FreeImage header files) I get 'HANDLE': undeclared identifier and many other windows related things become undeclared. I have no idea how to fix this. I really need both Windows.h and this function. How do I even begin to try to fix this? I looked at Utilities.h and FreeImage.h and I can't seem to figure out how to fix this. here is the error error LNK2019: unresolved external symbol "int __cdecl SwapRedBlue32(struct FIBITMAP *)" (?SwapRedBlue32@@YAHPEAUFIBITMAP@@@Z) referenced in function "public: static unsigned char * __cdecl BF::IO::ImageLoader::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int *,unsigned int *)" (?Load@ImageLoader@IO@BF@@SAPEAEAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAI1@Z)

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>