error: cuda.h No such file or directory

During compilation of my application I get the following message

error: cuda.h no such file or directory

This is when I compile my program with g++ 4.1.2 the file is a C++ file where I include cuda.h

Before I build this program I first build a library that is holding my .cu files. This library is called libGPURayTrace.a this all works fine

I’m working with CUDA 1.1 on Fedora Core 6

I have 2 cuda.h files located in:

/usr/include/ and in /usr/local/cuda/include/

The second one is from the old CUDA 1.0 i think but that shouldn’t be the problem.

I hope someone can comment on this problem or encountered the same.

That happens when you’re not fully awake…

it is not
#include “cuda.h” but #includecuda/cuda.h”
First problem solved. but now the second one. it cannot find the cudaMalloc functions.
I know cudaMalloc is not part of the cuda.h I think it is part of cuda_runtime.h or something like that. but where can I find that header?

cuda_runtime.h is installed with the toolkit. On my system, this is in /opt/cuda/include but I believe the default is /usr/local/cuda/include

Thanks, found it again. All those problems are solved only thing rested now is my undefined reference to my wrapper in my library… The library is linked, the header is included but still it is complaining about an undefined reference to… :argh:

Sheesh, sounds like a bad day for you today :)

Here are a few thoughts. The order in which libraries are linked matters, are you linking libraries in the proper order? Maybe your libraries makefile is missing a file to be compiled in? I myself am notorious for forgetting the “ClassName::” prefix to definitions of member functions: if it still manages to compile I get undefined references to that classes member function :)

I have the same issue described here in StackOverflow. Any help is appreciated