title: linker problem with libstdc++.so.6 in connection with cuda
body: <p>today i encountered a problem with linking my compiled cuda stuff.</p>
  
  <p>i have a uptodate debian testing w/ 2.6.32-3-amd64.</p>
  
  <p>i worked all day on my code. compiling from time to time.
  had no problem. but then after a minor code change i got following error:</p>
  
  <pre><code>gcc -o pa  CUDA.o  histogram256.o  histogram64.o  main.o  -lrt -lm -lcudart  -I. -I/data/cuda/include -I/data/cuda/C/common/inc -L/data/cuda/lib64
  /usr/bin/ld: main.o: undefined reference to symbol 'std::basic_ifstream&lt;char, std::char_traits&lt;char&gt; &gt;::close()@@GLIBCXX_3.4'
  /usr/bin/ld: note: 'std::basic_ifstream&lt;char, std::char_traits&lt;char&gt; &gt;::close()@@GLIBCXX_3.4' is defined in DSO /usr/lib64/libstdc++.so.6 so try adding it to the linker command line
  /usr/lib64/libstdc++.so.6: could not read symbols: Invalid operation
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>i changed the code back but the error stayed.</p>
  
  <p>the lib is where it should be. (/usr/lib64 is linked to /usr/lib)</p>
  
  <pre><code>ldd /usr/lib/libstdc++.so.6
      linux-vdso.so.1 =&gt;  (0x00007fff31fff000)
      libm.so.6 =&gt; /lib/libm.so.6 (0x00007f15f625a000)
      libc.so.6 =&gt; /lib/libc.so.6 (0x00007f15f5ef9000)
      /lib64/ld-linux-x86-64.so.2 (0x00007f15f680d000)
      libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x00007f15f5ce2000)
  </code></pre>
  
  <p>hopefully someone has a good advice.</p>