I'm trying to use the function EnumProcesses to check whether a process is running or not. But when I try to compile it, it returns an error, (which I don't get). I've looked up some stuff on google, and some pages adviced to install some kind a SDK. I'm using the MingW compiler now, (on Windows XP with Code::Blocks) but I have no idea which SDK, and were (probably MSDN?) I should download it. Does anybody knows something about which SDK I should use (if I really need to use one to compile this code).
These are my errors:
1 2
C:\Source\list_processes.o:list_processes.cpp:(.text+0x16c): undefined reference to `_EnumProcesses@12'
C:\Source\list_processes.o:list_processes.cpp:(.text+0x222): undefined reference to `_GetModuleBaseNameA@16'
You have to tell the linker to use Psapi.lib for those undefined functions. Check to see if it is already available.
Windows SDK can be downloaded here:
http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en
but check if you need it, it is also a DVD ISO image.
Thanks, I've found the MSDN thread with the same info, but the last time I tried to edit something in the compiler/linker, it killed my IDE's for 2 days. Is there some reference on the internet, or can someone give me one, how to tell the linker to use a certain lib?