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.
The code, itself, is pretty simple:
#include <windows.h>
#include <iostream>
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 < finish){
if(time > benchmarks[i]){
cout << benchmarks[i] / 1000 << endl;
i++;
}
return 0;
}
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.