title: NVCC CUDA cross compiling cannot find "-lcudart"
body: <p>I have installed CUDA 5.0 and NVCC on my Ubuntu virtual machine and have had problems compiling even a basic CUDA C program. The error is as follows:</p>
  
  <pre><code>user@ubuntu:~/CUDA$ nvcc helloworld.cu -o helloworld.o -target-cpu-arch=ARM -ccbin=/usr/bin/arm-linux-gnueabi-gcc-4.6 --machine=32
  /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: skipping incompatible /usr/local/cuda-5.0/bin/../lib/libcudart.so when searching for -lcudart
  /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libcudart.so when searching for -lcudart
  /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: cannot find -lcudart
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I have tried to research this problem and came across this link: <a href="https://stackoverflow.com/questions/17080280/skipping-incompatible-libcudart-so-when-searching-for-lcudart">skipping incompatible libcudart.so when searching for -lcudart</a></p>
  
  <p>And so I followed the advice that was offered on that link and added         </p>
  
  <pre><code> /usr/local/cuda-5.0/lib64 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>/usr/local/cuda-5.0/lib 
  </code></pre>
  
  <p>to my LD_LIBRARY_PATH environment variable and now this is the result of the </p>
  
  <pre><code>  user@ubuntu:~/CUDA$ echo $LD_LIBRARY_PATH 
    /usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64
    user@ubuntu:~/CUDA$ 
  </code></pre>
  
  <p>However, the problem still persists, please help.</p>