473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Link error LNK2019: unresolved external symbol

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;

}
/************************************/

--
AS

Nov 16 '05 #1
2 6375
On Tue, 2 Dec 2003 17:52:24 -0500, "AS" <az****@yahoo.com> wrote:
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 Fg**********@vqk.pbz 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
se******@idx.com--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.
Nov 16 '05 #2
AS
Yes I am.. but i got it figured out...
Thanks,
Regards,
AS
"Stephen Alpert" <he**@work.r.us> wrote in message
news:gl********************************@4ax.com...
On Tue, 2 Dec 2003 17:52:24 -0500, "AS" <az****@yahoo.com> wrote:
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 canuse 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 Fg**********@vqk.pbz 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
se******@idx.com--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.

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Krishnan | last post by:
Hi I am trying to build a small client-server program using OpenSSL functions. I get errors on trying to build the program using Visual Studio .Net (Visual C++ 7.0). I am new to Visual Studio...
3
by: Leith Bade | last post by:
I have been trying to use the new Visual C++ Toolkit 2003 with the VC6 IDE I set up the executable, inlcude, and library directories to point to the new compilers I had to fix a few errors in the...
2
by: Ney André de Mello Zunino | last post by:
Hello. I am having trouble building a simple project that uses one of the Standard C++ Library's IO facilities. The following is a stripped-down version that illustrates the problem: ...
0
by: Usman | last post by:
Hi I've a COM compiled in visual studio 6 that is internally using zlib library (an opensource library for compression). I've no problem compiling that code. But when I moved to visual...
6
by: ermanu | last post by:
Hello we don't know much about C. But we have to resolve this problem in order to work on our project. We're getting below errors whenever we try to build the code. We're trying to build the code...
4
by: Sanjay Kumar | last post by:
Folks ! I am working with VC++ after a long time and having problem linking latest xerces 2.7 in VC++ 2005 Express Edition. I have done following: 1. downloaded and unpacked the the...
1
by: developer | last post by:
Hi All I have made a .NET project. the files included are borland c++ files that i am migrate to VC++ .NET I am using Microsoft Visual C++ .NET 2003. the compilation goes through properly,...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
4
by: jk2l | last post by:
Error 10 error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function "public: void __thiscall GLTexture::Use(void)" (?Use@GLTexture@@QAEXXZ) GLTexture.obj Error 11 error...
2
by: huzzaa | last post by:
1>Employee main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Employee::nameDisplay(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.