VS2005 and function GetProcessMemoryInfo

Hello All,
I had some old code that ran perfectly in VS 6.0 and used the function GetProcessMemoryInfo located in psapi.h and paspi.lib. This was on a 32 bit machine.
I have a new computer which has the EM64T technology from intel. I have installed win XP 64 bit and VS 2005 Beta Version on this machine. I am trying to get my application to complie and run as a 64 bit application. The rest of the code complies and links just fine. However, the code is unable to link to the GetProcessMemoryInfo function in psapi.lib.
I know that there are 3 versions of psapi.lib currently in my system in the following folders
  1. Program Files(x86)\visual studio\vc\platformsdk\lib
  2. Program Files(x86)\visual studio\vc\platformsdk\lib\AMD64
  3. Program Files(x86)\visual studio\vc\platformsdk\lib\IA64
Currently, my program links to the first one. (since my machine is neither an AMD nor an Itanium). I know that Program Files(x86) is meant for 32 bit applications.
Does anyone know why the program fails to link? This function is still defined in the psapi.h file. However, it is unable to link with it in the library. Does win XP 64 bit need a new library for this function on the EM64T computer? Does this function necessitate a new library in just the Program Files folder <instead of Program Files(x86)>
Thanks,
Adwait
[1440 byte] By [AdwaitVaidya] at [2007-12-16]
# 1

Hi!

cite="midee2ba5de-4ce9-4ec7-8ea3-af0fb142427c@discussions.microsoft.com"

type="cite">I have a

new computer which has the EM64T technology from intel. I have

installed win XP 64 bit and VS 2005 Beta Version on this machine. I am

trying to get my application to complie and run as a 64 bit

application. The rest of the code complies and links just fine.

However, the code is unable to link to the GetProcessMemoryInfo

function in psapi.lib.
I know that there are 3 versions of psapi.lib currently in my system in

the following folders

  1. Program Files(x86)\visual studio\vc\platformsdk\lib
  2. Program Files(x86)\visual studio\vc\platformsdk\lib\AMD64
  3. Program Files(x86)\visual studio\vc\platformsdk\lib\IA64

Currently, my program links to the first one. (since my machine is

neither an AMD nor an Itanium). I know that Program Files(x86) is meant

for 32 bit applications.

You need to link against AMD64!

EM64T is just an implementation of AMD64...

-- 

Greetings

Jochen
My blog about Win32 and .NET

http://blog.kalmbachnet.de/

MVPUser at 2007-8-21 > top of Msdn Tech,Visual C++,Visual C++ General...
# 2
Hello Jochen,

Thanks for the tip. It worked. didnt know em64t and amd64 are the same :)

Thanks,
Adwait

AdwaitVaidya at 2007-8-21 > top of Msdn Tech,Visual C++,Visual C++ General...