I am getting linker errors when using clock_gettime
-
05-07-2021 - |
Frage
To use clock_gettime
what library do I need to link with? I am getting linker errors that clock_gettime
is undefined.
Lösung
Try linking to librt
:
gcc -o myprog myprog.c -lrt
(also note that you have to put the -lrt
flag after specifying the myprog.c
source file!)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow