ubuntu cuda linker error

hi guys

anyone knows why this happen?

i’m using ubuntu 9.04 with cuda sdk and cuda toolkit 2.1

kernel: 2.6.28-13-generic

gcc version: 4.2.4

.cu:24:26: error: cutil_inline.h: No such file or directory

.cu:25:28: error: cutil_gl_error.h: No such file or directory

my includes in teste.c are

#ifdef _WIN32


#  define NOMINMAX

#  include <windows.h>


// includes, system

#include <stdlib.h>

#include <stdio.h>

#include <string.h>

#include <math.h>

// includes, GL

//#include <GL/glew.h>

#if defined (__APPLE__) || defined(MACOSX)

#include <GLUT/glut.h>


#include <GL/glut.h>


// includes

#include <cuda_runtime.h>

#include <cutil_inline.h>

#include <cutil_gl_error.h>

#include <cuda_gl_interop.h>

#include <vector_types.h>

It is happening because you have not told the compiler where to find those includes from the SDK. You will need to add -I directives to point the compiler to wherever the SDK /inc and common/inc are located.

can you give me an example?

because i tried this

nvcc -c teste.cu -I/home/pinto/NVIDIA_CUDA_SDK/common/inc/

and gave me another error :S

In file included from teste.cu:19:

/home/pinto/NVIDIA_CUDA_SDK/common/inc/GL/glut.h:64:1: warning: "APIENTRY" redefined

In file included from /home/pinto/NVIDIA_CUDA_SDK/common/inc/GL/glut.h:59, from teste.cu:19:

/usr/include/GL/gl.h:105:1: warning: this is the location of the previous definition

Your original problem is fixed. It looks like your code has some include conflicts between system wide and SDK openGL includes. Time to fix those.

is solved :)
i remove the #include <GL/glew.h> and the #include <GL/glut.h> because seemed to be duplicates.

thanks for the help

sudo apt-get install libglut3-dev