I have some code that I am cross compiling on Linux with MinGW/Wine (there are windows libraries that I am being forced to use). So I am compiling on Linux with g++.exe
I have a need in this code to get the current time with millisecond resolution. When compiling with standard g++, I usually use something like this:
struct timespec now;
clock_gettime(CLOCK_REALTIME,&now);
This gives the error:
error: aggregate 'time2()::timespec now' has incomplete type and cannot be defined
What is the equivalent that I can use that would work with g++.exe compiler?
EDIT, the compilation cmd is:
g++.exe -std=c++0x -g -Wall -O2 -o test.exe test.cpp