I am trying to compile a program that uses the function clock_gettime. The man page on Ubuntu says it has to be compiled with -lrt option.
If I issue the command
gcc myprogram.c -lrt
my program compiles fine.
Now how do I add the option -lrt to Eclipse. I already tried adding -lrt to:
GCC Compiler->Miscellaneous->Other flags and GCC C Linker->libraries
This question is posted here - however the answer does not seem to help me. Compiling in Eclipse with gcc's -lpthread and -lrt set