undefined reference to `clock_getres’

If you are getting this error message:

$ gcc showhz.c -o showhz
/tmp/cc073N3P.o: In function `main':
showhz.c:(.text+0x3c): undefined reference to `clock_getres'

Then you need to add -lrt in your compilation parameter:

$ gcc showhz.c -o showhz -lrt

All right!?

Source: http://stackoverflow.com/questions/922492/use-of-clockgetres-newbie-linux-c

Advertisements

2 thoughts on “undefined reference to `clock_getres’

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s