title: Having a libpthread.so linking trouble on Ubuntu
body: <p>I've downloaded source code from this site <a href="http://mnbayazit.com/406/bayazit" rel="nofollow">http://mnbayazit.com/406/bayazit</a> </p>
  
  <p>This project has some dependencies: </p>
  
  <p><em>Libraries: FTGL (for fonts), FreeType2 (needed by FTGL), GLFW (for windows and keyboard input), OpenGL.
  Software: CMake (if it doesn't build) But I'm having a problem with it.</em></p>
  
  <p>And installation guide looks like </p>
  
  <p><em>To build and run:</em></p>
  
  <pre><code>cmake .
  make
  ./conv
  </code></pre>
  
  <p>and I am trying to build it. </p>
  
  <pre><code>$ cmake .  
  </code></pre>
  
  <p>goes just fine, but when I'm trying to</p>
  
  <pre><code>$ make
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Linking CXX executable conv
  /usr/bin/ld: /usr/local/lib/libglfw.a(x11_init.o): undefined reference to symbol 'pthread_kill@@GLIBC_2.0'
  /usr/bin/ld: note: 'pthread_kill@@GLIBC_2.0' is defined in DSO /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker command line
  /lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
  collect2: ld returned 1 exit status
  make[2]: *** [conv] Error 1
  make[1]: *** [CMakeFiles/conv.dir/all] Error 2
  make: *** [all] Error 2
  </code></pre>
  
  <p>I googled this problem and I tried to change CMakeLists.txt by changing</p>
  
  <pre><code>SET(CMAKE_BUILD_TYPE distribution)
  SET(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3")
  </code></pre>
  
  <p>to</p>
  
  <pre><code>SET(CMAKE_BUILD_TYPE distribution)
  SET(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3 -L/usr/lib/i386-linux-gnu/lpthread")
  </code></pre>
  
  <p>But nothing changed.
  I googled hardly for a couple of hours, but I can't really solve the problem, I'm still having the same error.
  By the way, </p>
  
  <pre><code>TARGET_LINK_LIBRARIES(conv Xrandr pthread ftgl glfw ${OPENGL_LIBRARIES})
  </code></pre>
  
  <p>I suppose, I needn't change anything in this string?</p>
  
  <p>P.S. I'm using ubuntu 11.10 if that means something :)</p>