LoadLibrary("gdi32.dll") is returning NULL

nobody wrote on Wednesday, April 18, 2007:

Inside glfwInit() for win32…

Tried building static and dynamic libraries, no change.

Having the same problem as this guy here:

http://www.gamedev.net/community/forums/topic.asp?topic_id=437090

elmindreda wrote on Thursday, April 19, 2007:

Hmm, that’s weird. Please spam us with details and something might stand out.

nobody wrote on Thursday, April 19, 2007:

Not sure what else to post. When it gets to that line to LoadLibrary, that function call returns NULL. I cannot imagine why this would be, if someone could post a working VC++ project file that builds a sample and shows exactly what settings are working to make it load.

elmindreda wrote on Friday, April 20, 2007:

Which version of Windows? Which CPU architecture? What sort of user account?

There are to my knowledge very few, if any, compiler settings that would let the code build, run and yet cause it to fail in this manner.

nobody wrote on Friday, April 20, 2007:

Windows Vista Home Premium 32bit, AMD Opteron 275, 2.7GB of Memory, Tyan K8WE mobo, GF 8800 GTX factory overclocked.

Turns out another guy posted a working VC++ solution on gamedev.net, it runs fine, although with a console window that I’d like to get rid of. I am pouring over his project settings to figure out why his works and mine doesn’t.

I believe this is not a compiler issue but a linker setting issue.

elmindreda wrote on Saturday, April 21, 2007:

Verified on XPSP2 on my machine, compiled with VS2005. Interestingly, the same code runs just fine compiled with Cygwin. My official stance on the matter is "huh?!", pending further investigation.

elmindreda wrote on Saturday, April 21, 2007:

Ah, the solution, at least on my end, was to set the compiler character set to multibyte. I was tipped off by a compiler warning for lib/win32/win32_init.c.