Compiling CUDA Program Compiling a program with NVCC

Hi guys, I’m very new to the CUDA language and am trying to get a hello world type program to compile using NVCC. Here is the code I’m trying to compile:

#include <stdio.h>
#include <stdlib.h>

int main()
printf(“Hello World”);
return 0;

I realize it doesn’t really use any CUDA functionality but my goal here is to be able to compile it through NVCC and run the associated executable. The code compiles fine and generates both a.out and a .linkinfo file. The problem is as soon as I run a.out, I get the following error message:

./a.out: error while loading shared libraries: cannot open shared object file: No such file or directory

Why am I receiving this message and what I can I do to fix it?


Where is your
find / | grep libcudart
I’m not sure about the technical details of compiling/linking, but nvcc assumes that you intend to use cuda, and thus demands the cuda runtime to be present.

Ok, the solution to this was I did not have my path variables configured correctly. Once I fixed them it worked fine. Thanks!!!

How do you have your path variables set? I’m having the same problem with the samples.