I have this function:
void Estatisticas::iniciarTempo() {
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tempoInicial);
}
I'm trying to use clock_gettime by ctime, but I getting some errors:
"undefined reference to 'clock_gettime'"
Thanks a lot.
From the clock_gettime/clock_getres manpage:
Link with -lrt.
The symbol is defined in the POSIX Real Time library. Add "-lrt" to your compilation line:
gcc -lrt -o myprog myprog.c