Problem with SetSuspendState
I write a small application to enter the computer to Standby Mode:
#include "stdafx.h"
#include <windows.h>
#include <PowrProf.h>
int _tmain(int argc, _TCHAR* argv[])
{
SetSuspendState(FALSE, FALSE, FALSE);
return 0;
}
I get this error: 1>Standby.obj : error LNK2001: unresolved external symbol _SetSuspendState@12 1>C:\Documents and Settings\Sobak\Desktop\Standby\Release\Standby.exe : fatal error LNK1120: 1 unresolved ext开发者_运维问答ernalsexternals
How can I fix it?
P.S. I use Visual Studio 2005
Thank you in advance.
You should link your programm with the PowrProf.lib
library. You could do it by adding the following string:
#pragma comment(lib, "PowrProf.lib")
精彩评论