Link error LNK2019: unresolved external symbol

A

AS

Hi,

I'm trying to use some power management features with windows 2000
Professional and I have visual studio .net 2003 installed with the latest
service packs and everything... I want to write a simple app to turn the
system into sleep mode/suspend mode. As per documentation of ACPI, you can
use the power options by including the Powrprof.h file and use the
Powrprof.lib file in your project, which I did, but when I build, it
compiles fine but I get this Link error.. :

error LNK2019: unresolved external symbol "unsigned char __stdcall
IsPwrSuspendAllowed(void)" (?IsPwrSuspendAllowed@@YGEXZ) referenced in
function _main
fatal error LNK1120: 1 unresolved externals


The code is as shown below :...
Any Ideas on what I'm missing here... please help...

Thanks,
Regards,
AS.

/******************************************/
#include "stdafx.h"

#include "Windows.h"

#include "Powrprof.h"


int _tmain(int argc, _TCHAR* argv[]) {

if (isPwrSuspendAllowed() == TRUE) {

printf("Suspend state is allowed\n");

}

else {

printf("Suspend state is NOT allowed\n");

}

return 0;

}
/************************************/
 
S

Stephen Alpert

Hi,

I'm trying to use some power management features with windows 2000
Professional and I have visual studio .net 2003 installed with the latest
service packs and everything... I want to write a simple app to turn the
system into sleep mode/suspend mode. As per documentation of ACPI, you can
use the power options by including the Powrprof.h file and use the
Powrprof.lib file in your project, which I did, but when I build, it
compiles fine but I get this Link error.. :

error LNK2019: unresolved external symbol "unsigned char __stdcall
IsPwrSuspendAllowed(void)" (?IsPwrSuspendAllowed@@YGEXZ) referenced in
function _main
fatal error LNK1120: 1 unresolved externals
...[ stuff deleted ]...

Are you linking with Powrprof.lib?

/steveA
Steve Alpert
my email (e-mail address removed) is encrypted with ROT13 (www.rot13.org)
-------------------------------------------
NOTICE OF CONFIDENTIALITY
-------------------------------------------
The information in this email, including attachments, may be confidential
and/or privileged and may contain confidential health information. This
email is intended to be reviewed only by the individual or organization
named as addressee. If you have received this email in error please
notify IDX immediately--by return message to the sender or to
(e-mail address removed)--and destroy all copies of this message and any
attachments. Please note that any views or opinions presented in this
email are solely those of the author and do not necessarily represent
those of IDX. Confidential health information is protected by state and
federal law, including, but not limited to, the Health Insurance
Portability and Accountability Act of 1996 and related regulations.
 
A

AS

Yes I am.. but i got it figured out...
Thanks,
Regards,
AS
Stephen Alpert said:
Hi,

I'm trying to use some power management features with windows 2000
Professional and I have visual studio .net 2003 installed with the latest
service packs and everything... I want to write a simple app to turn the
system into sleep mode/suspend mode. As per documentation of ACPI, you can
use the power options by including the Powrprof.h file and use the
Powrprof.lib file in your project, which I did, but when I build, it
compiles fine but I get this Link error.. :

error LNK2019: unresolved external symbol "unsigned char __stdcall
IsPwrSuspendAllowed(void)" (?IsPwrSuspendAllowed@@YGEXZ) referenced in
function _main
fatal error LNK1120: 1 unresolved externals
...[ stuff deleted ]...

Are you linking with Powrprof.lib?

/steveA
Steve Alpert
my email (e-mail address removed) is encrypted with ROT13 (www.rot13.org)
-------------------------------------------
NOTICE OF CONFIDENTIALITY
-------------------------------------------
The information in this email, including attachments, may be confidential
and/or privileged and may contain confidential health information. This
email is intended to be reviewed only by the individual or organization
named as addressee. If you have received this email in error please
notify IDX immediately--by return message to the sender or to
(e-mail address removed)--and destroy all copies of this message and any
attachments. Please note that any views or opinions presented in this
email are solely those of the author and do not necessarily represent
those of IDX. Confidential health information is protected by state and
federal law, including, but not limited to, the Health Insurance
Portability and Accountability Act of 1996 and related regulations.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top