473,725 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error LNK2019: unresolved external symbol "long __stdca

Hi,
I'm trying to use some power management features with windowsx xp
and I have visual studio .net 2003 installed.
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 "long __stdcall
CallNtPowerInfo rmation(enum POWER_INFORMATI ON_LEVE,void*,u signed
long,void*,unsi gnedlong)"
(?CallNtPowerIn formation@@YGJW 4POWER_INFORMAT ION_LEVEL@@PAXK 1K@Z)
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 <stdio.h>
#include <lmaccess.h>

#include <powrprof.h>
int _tmain(int argc, _TCHAR* argv[])
{
SYSTEM_POWER_CA PABILITIES cap;

NTSTATUS status;
status = CallNtPowerInfo rmation(
SystemPowerCapa bilities,
NULL,
0,
&cap,
sizeof(cap));

return 0;
}

Nov 17 '05 #1
4 2797
"naveenadev i" <na**********@y ahoo-dot-com.no-spam.invalid> wrote in message
news:41******** @Usenet.com...
Hi,
I'm trying to use some power management features with windowsx xp
and I have visual studio .net 2003 installed.
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 "long __stdcall
CallNtPowerInfo rmation(enum POWER_INFORMATI ON_LEVE,void*,u signed
long,void*,unsi gnedlong)"
(?CallNtPowerIn formation@@YGJW 4POWER_INFORMAT ION_LEVEL@@PAXK 1K@Z)
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...


I suspect that you need to link against Powrprof.lib.
--
Jeff Partch [VC++ MVP]
Nov 17 '05 #2
I am having the same issue. Powrprof.lib is listed in my IDE to be linked.
Any other ideas?

Thanks.
Nate

"Jeff Partch [MVP]" wrote:
"naveenadev i" <na**********@y ahoo-dot-com.no-spam.invalid> wrote in message
news:41******** @Usenet.com...
Hi,
I'm trying to use some power management features with windowsx xp
and I have visual studio .net 2003 installed.
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 "long __stdcall
CallNtPowerInfo rmation(enum POWER_INFORMATI ON_LEVE,void*,u signed
long,void*,unsi gnedlong)"
(?CallNtPowerIn formation@@YGJW 4POWER_INFORMAT ION_LEVEL@@PAXK 1K@Z)
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...


I suspect that you need to link against Powrprof.lib.
--
Jeff Partch [VC++ MVP]

Nov 17 '05 #3

Your problem is that you didn't put the 'extern "C" {}' around the #include<pawrpr of.h>.
I had the same problem and that fixed it.

Good luck!
--Ed
Hi,
I'm trying to use some power management features with windowsx xp and I have visual studio .net 2003 installed.
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 "long __stdcall

CallNtPowerInfo rmation(enum POWER_INFORMATI ON_LEVE,void*,u signed
long,void*,unsi gnedlong)"
(?CallNtPowerIn formation@@YGJW 4POWER_INFORMAT ION_LEVEL@@PAXK 1K@Z)
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 <stdio.h>
#include <lmaccess.h>
#include <powrprof.h>
int _tmain(int argc, _TCHAR* argv[])

{
SYSTEM_POWER_CA PABILITIES cap;
NTSTATUS status;

status = CallNtPowerInfo rmation(
SystemPowerCapa bilities,
NULL,
0,
&cap,
sizeof(cap));
return 0;

}


User submitted from AEWNET (http://www.aewnet.com/)
Nov 17 '05 #4

Hi,
U can use the LoadLibrary to load the Powrprof.lib and get a pointer to that function
with GetProcAddress function.
i have used it n its wrking fine.

Regards,
VK

Hi,
I'm trying to use some power management features with windowsx xp
and I have visual studio .net 2003 installed.
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 "long __stdcall
CallNtPowerInfo rmation(enum POWER_INFORMATI ON_LEVE,void*,u signed
long,void*,unsi gnedlong)"
(?CallNtPowerIn formation@@YGJW 4POWER_INFORMAT ION_LEVEL@@PAXK 1K@Z)
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 <stdio.h>
#include <lmaccess.h>

#include <powrprof.h>
int _tmain(int argc, _TCHAR* argv[])
{
SYSTEM_POWER_CA PABILITIES cap;

NTSTATUS status;
status = CallNtPowerInfo rmation(
SystemPowerCapa bilities,
NULL,
0,
&cap,
sizeof(cap));

return 0;
}


User submitted from AEWNET (http://www.aewnet.com/)
Nov 17 '05 #5

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

Similar topics

17
3943
by: Adam Ierymenko | last post by:
I have a question that might have been asked before, but I have not been able to find anything via groups.google.com or any web search that is definative. I am writing an evolutionary AI application in C++. I want to use 32-bit integers, and I want the application to be able to save it's state in a portable fashion. The obvious choice would be to use the "long" type, as it is deined to be at least 32 bits in size. However, the...
6
2612
by: Otto Wyss | last post by:
I've the following function declaration: wxTree GetLastChild (const wxTree& item, long& cookie) const; I'd like to make the cookie parameter optional, i.e. "long& cookie = ....", without breaking any software using the old API. The implementation looks like wxTree wxTreeListMainWindow::GetLastChild (const wxTree& item, long& cookie) const {
16
3778
by: ondekoza | last post by:
Hello, I need to convert the string "FFFFFFFF" to a long. To convert this string I tried the following: >>> 0xffffffff -1 >>> 0xffffffffL 4294967295L OK, this is what I want, so I tried
12
43450
by: Zero | last post by:
Hi everybody, i want to write a small program, which shows me the biggest and smallest number in dependance of the data type. For int the command could be: printf("\n%20s\t%7u\t%13i\t%13i","signed int",sizeof(signed int),INT_MIN,INT_MAX);
3
7297
by: ext | last post by:
"A "long" in C is an "int" in C#." Does this mean that whenever passing a parameter to a C function which expects a long type, the variable on C# side should be declared as int type? What if in the following case, should the parameter "level" be type of int as well? public interface XoInterface {
0
2152
by: Curious | last post by:
Hi, I have two columns defined as DateTime type in the Visual Designer, i.e., Dataset.xsd. In the grid to which the columns are bound, they're both displayed as date, for instance, 5/23/2007. It seems that they're using the default "short date" format. I want to use the "long date" format to display the actual hour/minute/
0
8888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.