title: (g++ 4.8.2) Why do I need to specify -pthread to link sem_post?
body: <p>In g++ 4.8.2 apparently one has to specify <em>-pthread</em> flag to include the reference to <em>sem_post</em>.</p>
  
  <pre>
  /usr/bin/ld: obj/loader.o: undefined reference to symbol 'sem_post@@GLIBC_2.2.5'
  //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
  </pre>
  
  <p>Why is that? What if one wants to explicitly not have to link that library to ensure no threads are ever run?</p>
  
  <p>Has anything changed?</p>
  
  <p>Thanks! </p>