Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2005

Tip: Looking for answers? Try searching our database.

error LNK2019: unresolved external symbol "long __stdca

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
naveenadevi - 01 Oct 2004 19:03 GMT
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
CallNtPowerInformation(enum POWER_INFORMATION_LEVE,void*,usigned
long,void*,unsignedlong)"
(?CallNtPowerInformation@@YGJW4POWER_INFORMATION_LEVEL@@PAXK1K@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_CAPABILITIES cap;

   NTSTATUS status;
    status = CallNtPowerInformation(
                    SystemPowerCapabilities,
                    NULL,
                    0,
                    &cap,
                    sizeof(cap));

    return 0;
}
Jeff Partch [MVP] - 02 Oct 2004 01:41 GMT
> Hi,
>
[quoted text clipped - 15 lines]
> 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.
Signature

Jeff Partch [VC++ MVP]

Nate - 18 Oct 2004 22:17 GMT
I am having the same issue.  Powrprof.lib is listed in my IDE to be linked.  
Any other ideas?

Thanks.
Nate

> > Hi,
> >
[quoted text clipped - 17 lines]
>
> I suspect that you need to link against Powrprof.lib.
Guest - 03 Jan 2005 12:18 GMT
Your problem is that you didn't put the 'extern "C" {}' around the #include<pawrprof.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
[quoted text clipped - 32 lines]
> >     return 0;
> }

User submitted from AEWNET (http://www.aewnet.com/)
Guest - 31 May 2005 06:27 GMT
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,
>
[quoted text clipped - 41 lines]
>     return 0;
> }

User submitted from AEWNET (http://www.aewnet.com/)

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.