title: Linking error: DSO missing from command line
body: <p>I am rather new to Linux (using Ubuntu 14.04 LTS 64bit), coming from Windows, and am attempting to port over an existing CUDA project of mine.</p>
  
  <p>When linking via</p>
  
  <pre><code>/usr/local/cuda/bin/nvcc -arch=compute_30 -code=sm_30,compute_30 -o Main.o Display.o FileUtil.o Timer.o NeuralNetwork.o -L/usr/lib -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu -L/usr/local/cuda/lib64 -lGLEW -lglfw3 -lGL -lGLU -lcuda -lcudart
  </code></pre>
  
  <p>I encounter the following error:</p>
  
  <pre><code>/usr/bin/ld: /usr/local/lib/libglfw3.a(x11_clipboard.c.o): undefined reference to  symbol 'XConvertSelection'
  //usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
  collect2: error: ld returned 1 exit status
  make: *** [CUDANN] Error 1
  </code></pre>
  
  <p>The answer seems closely related to the solutions in this post (<a href="https://stackoverflow.com/questions/19901934/strange-linking-error-dso-missing-from-command-line">Strange linking error: DSO missing from command line</a>), though given my inexperience with Linux I was unable to adapt them to my own problem.</p>
  
  <p>Any ideas on what the problem could be?</p>
  
  <p>Here is the full output during compilation: <a href="https://gist.github.com/wbolden/857eddd11e4dcb915c02" rel="noreferrer">https://gist.github.com/wbolden/857eddd11e4dcb915c02</a></p>
  
  <p>And here is my attempt at a Makefile:
  <a href="https://gist.github.com/wbolden/135033daae04ed0d8cf3" rel="noreferrer">https://gist.github.com/wbolden/135033daae04ed0d8cf3</a></p>