title: GCC (MinGW) Linker Fails When Trying to Use GetProcessImageFileName
body: <p>I am trying to retrieve the name of remote processes using "GetProcessImageFileName". However, the GCC (MinGW) linker fails with the following error(s):</p>
  
  <pre><code>&lt;source_file&gt;.c: In function '&lt;function_name&gt;':
   warning: implicit declaration of function 'GetProcessImageFileName' [-Wimplicit-function-declaration]
   GetProcessImageFileName(hProcess, szProcessName, MAX_PATH);
   ^
  undefined reference to `GetProcessImageFileName'
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  
  <p>I've tried compiling with "-lPsapi" and "-lKernel32" but I get the same results. "GetProcessImageFileName" is declared in "Psapi.h".</p>
  
  <p>I'm using a machine with Windows 7 Professional 64-bit and GCC 4.8.1. Any ideas what's going on?</p>