Really Annoying Error - Fixed

Started by
3 comments, last by programmermattc 17 years, 6 months ago
I've been getting this error since typing this code in that I've had working before: main.obj : error LNK2019: unresolved external symbol __imp__UnregisterClassA@8 referenced in function "bool __cdecl UnregisterWindowClasses(struct HINSTANCE__ *)" (?UnregisterWindowClasses@@YA_NPAUHINSTANCE__@@@Z) UnregisterWindowClass is a function of my own. It wouldn't be such a big problem but I'm getting it 10 different times on other functions like RegisterClass, etc... It's definately possible I don't have something linked right in C++ Express Edition because last time I compiled it in the older C++ compiler. I linked it enough so Windows.h wouldn't error but I think it's not finding these basic Windows functions. I already tried deleting the .obj and recompiling. Any ideas? [Edited by - programmermattc on September 27, 2006 5:01:01 PM]

=============================RhinoXNA - Easily start building 2D games in XNA!Projects

Advertisement
Don't use function names that are already defined in windows.h. If you have to use the names, #undefine them.
I'm not, I'm using the predefined RegisterClass inside my RegisterWindowClasses() and the error is saying that using that predefined func in my own is wrong. (Sorry it sounded kind of like I named it RegisterClass)

=============================RhinoXNA - Easily start building 2D games in XNA!Projects

Are you sure your project is set up as a Win32 application? AFAIK the compiler won't know to link against the Windows libraries if the project is merely set up as a console application.


P.S. Oops never mind, I didn't see the FIXED in the thread title. =0
Thats ok, I had started my application as a blank project and tried to include it without adding this reallyl ong line of Additional Dependencies to a file located somewhere within C++'s folders. Basically I didn't read far enough of the 'Do this with the SDK' that MS has up on their site.

=============================RhinoXNA - Easily start building 2D games in XNA!Projects

This topic is closed to new replies.

Advertisement