title: Linking on Ubuntu 12.04 - undefined reference to `clock_gettime@GLIBC_2.17'
body: <p>I am compiling a C++ project on Ubuntu 12.04 and I get a linking error stating</p>
  <blockquote>
  <p>undefined reference to `clock_gettime@GLIBC_2.17'</p>
  <p>undefined reference to `clock_getres@GLIBC_2.17'</p>
  </blockquote>
  <p>I read a lot of threads about this issue and I tried all the usual solutions (separately). Such as adding the <code>-lrt</code> flag to the <code>g++</code> command line (I tried in the beginning and in the end), setting the cmake linker flags variables to <code>-lrt</code>, adding the librt.so location to the <code>link_directories</code> variable or even to the <code>target_link_libraries</code>. None of this worked.</p>
  <p>When I run <code>ldd --version</code> I get</p>
  <blockquote>
  <p>ldd (Ubuntu EGLIBC 2.15-0ubuntu10.12) 2.15</p>
  </blockquote>
  <p>And for what I understood from research this is the last glibc version for Ubuntu 12.04. But the error references to glibc 2.17...
  So My question is: Am I getting this error because of the gclib version? Is there any way I can get a more recent version for Ubuntu 12.04?</p>
  <p>Thank you in advance!</p>