0
clock_gettime我有這樣的功能:錯誤中的ctime
無效Estatisticas :: iniciarTempo(){
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tempoInicial);
}
我試圖通過的ctime使用clock_gettime,但我越來越一些錯誤:
「未定義的引用 'clock_gettime'」
非常感謝。
clock_gettime我有這樣的功能:錯誤中的ctime
無效Estatisticas :: iniciarTempo(){
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &tempoInicial);
}
我試圖通過的ctime使用clock_gettime,但我越來越一些錯誤:
「未定義的引用 'clock_gettime'」
非常感謝。
從clock_gettime/clock_getres手冊頁:
鏈接與-lrt。
該符號在POSIX Real Time庫中定義。在您的彙編行中添加「-lrt」:
gcc -lrt -o myprog myprog.c