title: Undefined reference to timeGetTime() in g++
body: <p>I'm using g++ command line under Windows 10 to build a basic timing loop and am getting the error: " undefined reference to `timeGetTime@0' " when attempting to compile.</p>
  
  <p>The code, itself, is pretty simple:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  int main(){
     int start = timeGetTime();
     int finish = 10000;
     int benchmarks [9] = {1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000};
     int i = 0;
     int time = timeGetTime() - start;
     while( time &lt; finish){
         if(time &gt; benchmarks[i]){
             cout &lt;&lt; benchmarks[i] / 1000 &lt;&lt; endl;
             i++;
         }
  
     return 0;
  }
  </code></pre>
  
  <p>Not sure what I need to do to get g++ to play nicely with the WinAPI. I can't help but wonder if it's an issue with the linker.</p>