title: undefined reference to symbol 'cudaStreamCreate'
body: <p>Building my project using CMake I get the following linker error and don't know how to solve it. Using <code>make VERBOSE=1</code> reveals the generated commands which look ok to me:</p>
  
  <pre><code>azg@HPC:~/code/myproject/build_debug$ /usr/bin/c++ -Wall -Wextra -Wshadow -Woverloaded
     -virtual  -g3 -ggdb3 -fopenmp CMakeFiles/mymain.dir/main/cpp
     /algorithm/mymain.cc.o -o mymain -rdynamic 
     my_library.a /opt/dev/boost/lib/libboost_filesystem.a /opt/dev/boost      
     /lib/libboost_graph.a /opt/dev/boost/lib/libboost_system.a /opt/dev/boost
     /lib/libboost_program_options.a /opt/dev/boost/lib/libboost_chrono.a /usr/local
     /hdf5/lib/libhdf5.so -lz -lrt -ldl -lm /usr/local/cuda-5.0/lib64/libcudart.so -lcuda 
     /usr/local/cuda-5.0/lib64/libcublas.so /opt/dev/magma/1.4.0-beta2/lib/libmagma.a  
     /opt/intel/lib/intel64/libimf.so -Wl,-rpath,/usr/local/hdf5/lib:/usr/local/cuda-
     5.0/lib64:/opt/intel/lib/intel64/usr/bin/ld:/usr/local/cuda-5.0/lib64/libcublas.so: 
  </code></pre>
  
  <p>and the linker error:</p>
  
  <pre><code>undefined reference to symbol 'cudaStreamCreate'
  /usr/bin/ld: note: 'cudaStreamCreate' is defined in DSO /usr/local/cuda-5.0/lib64/libcudart.so so try adding it to the linker command line
  /usr/local/cuda-5.0/lib64/libcudart.so: could not read symbols: Invalid operation
  collect2: ld returned 1 exit status
  </code></pre>