Mega Search
23.2 Million


Sign Up

Make a donation  
can't use GetProcessMemoryInfo  
News Group: embarcadero.public.cppbuilder.rtl

C++ Builder XE3 unable to link this

{code}
//---------------------------------------------------------------------------

#include 
#include 
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;

int GetProcessMemory()
{
	PROCESS_MEMORY_COUNTERS info;

	GetProcessMemoryInfo( GetCurrentProcess( ), &info, sizeof(info) );
	return (size_t)info.WorkingSetSize;
}

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
 GetProcessMemory();
}
{code}

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 22-Dec-2012, at 9:12 AM EST
From: Attila Csosz
 
Re: can't use GetProcessMemoryInfo  
News Group: embarcadero.public.cppbuilder.rtl
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> Attila wrote:
> 
> > C++ Builder XE3 unable to link this
> 
> Did you add psapi.lib to your project?
> 
> --
> Remy Lebeau (TeamB)

The error message:
[ilink32 Error] Error: Unresolved external 'GetProcessMemoryInfo' referenced from C:\USERS\\DOCUMENTS\RAD STUDIO\PROJECTS\WIN32\DEBUG\UNIT1.OBJ
[ilink32 Error] Error: Unable to perform link

Library path is: $(BDSLIB)\$(PLATFORM)\debug

I have found psapi.lib in c:\Program Files (x86)\Embarcadero\RAD Studio\10.0\lib\win32\*release*\psdk\

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Dec-2012, at 7:40 AM EST
From: Attila Csosz