Sign in to follow this  
Red2048

VC2005 ScreenSaver Link Error.

Recommended Posts

Under VC6 I've always started with a empty "Win32 Application" project and buildup a screensaver from there. Now under VC2005(8) when doing the same ("Win32" > "Win32 Project" > "empty") I did run in a few "unresolved external symbol" link errors for ScrnSave.lib when compiling. All but one were solved by adding "commctrl.h". I still can't solve the next error: ScrnSave.lib(scrnsave.obj) : error LNK2019: unresolved external symbol _ScreenSaverProc@16 / referenced in function _RealScreenSaverProc@16 What do I need to do/have in order to solve this under VS2005(8)? Minimalistic source for compiling:
#include <windows.h>
#include <scrnsave.h>
#include <commctrl.h>                        // not required under VC6

#pragma comment(lib, "ScrnSave.lib")
#pragma comment(lib, "comctl32.lib")         // not required under VC6

BOOL WINAPI RegisterDialogClasses(HANDLE hInst) {
    return true;
}

BOOL WINAPI ScreenSaverConfigureDialog ( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) {
    return false;
}

LRESULT WINAPI ScreenSaverProc ( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) {
    return DefScreenSaverProc(hWnd, message, wParam, lParam);
}


Share this post


Link to post
Share on other sites
Yes, and no I didn't, did it and had same result.
After a while I noticed that UNICODE was set in the project settings, turned it off and it compiled fine with and without extern "C".
Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this