linker error with scrnsaver.lib

Started by
0 comments, last by Askadar 22 years, 4 months ago
Hi, I''m trying to build my own screen saver. I supplied the ScreenSaverProc, ScreenSaverConfigureDialog and the RegisterWindowClasses, link the scrnsaver.lib and included the include file. I also export the two windowprocs. It compiles fine, but when I try to build it, I get the following linker error: scrnsave.lib(scrnsave.obj) : error LNK2001: Nichtaufgeloestes externes Symbol _RegisterDialogClasses@4 (it means "unresolved extern symbol") Here is my RegisterDialogClasses function: BOOL WINAPI RegisterDialogClasses(HINSTANCE hInst) { return 1; } Any ideas what I''m doing wrong?
Kill mages first!
Advertisement
Hehe, now I''m answering my own question....

The problem was, that this lib is an old C lib, and so it expected an C-style function to be exported. So I put my function into extern "C" { }, but that just led to an error that I can''t overload a C function. Great, how do I define it? I looked at the scrnsave.h and found out that in an extern block the function header was declared.

The only solution I found to place this function in a .c file instead of having it in my .cpp file.

Maybe I''m just too inexperienced, but it seems this API is kinda picky about being used...
Kill mages first!

This topic is closed to new replies.

Advertisement