error linking cuda objects with gcc

I keep getting following errors when I am trying to link my cuda programs with gcc.
I tried compiling with both cuda 2.1 and 2.2
also my gcc version is 4.1.2

I have set my LD_LIBRARY_PATH properly and also using -L with -lcudart and -lcuda options

sorry if this topic is repeated but the search option is not working on this site for me.

gpu/classInterpolationCuda.o: In function __sti____cudaRegisterAll_57_tmpxft_00007755_00000000_4_c lassInterpolationCuda_cpp1_ii_397df274': tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xfc): undefined reference to __cudaRegisterFatBinary’
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0x157): undefined reference to __cudaRegisterFunction' tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0x1a1): undefined reference to __cudaRegisterFunction’
gpu/classInterpolationCuda.o: In function __cudaUnregisterBinaryUtil': tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0x1ce): undefined reference to __cudaUnregisterFatBinary’
gpu/classInterpolationCuda.o: In function __device_stub__Z35interpolateMapStaniforthCote_kernelPfS _S_S_S_S_iiiiiifiiiiiiiii': tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0x231): undefined reference to cudaSetupArgument’
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0x254): undefined reference to cudaSetupArgument' tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0x277): undefined reference to cudaSetupArgument’
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0x29a): undefined reference to cudaSetupArgument' tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0x2bd): undefined reference to cudaSetupArgument’
gpu/classInterpolationCuda.o:tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0x2e0): more undefined references to cudaSetupArgument' follow gpu/classInterpolationCuda.o: In function interpolateMapStaniforthCote(float, Array3D&, Array3D&, Array3D&, Array3D&, Array3D&, Array3D&, Array3D&, Array3D&, Array3D&, int, int, int)’:
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xb78): undefined reference to cudaMalloc' tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xb8a): undefined reference to cudaMalloc’
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xb9c): undefined reference to cudaMalloc' tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xbae): undefined reference to cudaMalloc’
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xbc0): undefined reference to cudaMalloc' gpu/classInterpolationCuda.o:tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xbd2): more undefined references to cudaMalloc’ follow
gpu/classInterpolationCuda.o: In function interpolateMapStaniforthCote(float, Array3D<float>&, Array3D<float>&, Array3D<float>&, Array3D<float>&, Array3D<float>&, Array3D<float>&, Array3D<float>&, Array3D<float>&, Array3D<float>&, int, int, int)': tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xc26): undefined reference to cudaMemcpy’
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xc44): undefined reference to cudaMemcpy' tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xc62): undefined reference to cudaMemcpy’
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xc7d): undefined reference to cudaMemcpy' tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xc98): undefined reference to cudaMemcpy’
gpu/classInterpolationCuda.o:tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xcb3): more undefined references to cudaMemcpy' follow gpu/classInterpolationCuda.o: In function interpolateMapStaniforthCote(float, Array3D&, Array3D&, Array3D&, Array3D&, Array3D&, Array3D&, Array3D&, Array3D&, Array3D&, int, int, int)’:
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xd93): undefined reference to cudaConfigureCall' tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xe8b): undefined reference to cudaConfigureCall’
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xf6d): undefined reference to cudaMemcpy' tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xf88): undefined reference to cudaMemcpy’
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xfa3): undefined reference to cudaMemcpy' gpu/classInterpolationCuda.o: In function allocate_memory(void*, void*, unsigned long)’:
tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xfc7): undefined reference to cudaMallocHost' tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text+0xfd4): undefined reference to cudaMalloc’
gpu/classInterpolationCuda.o: In function cudaError cudaLaunch<char>(char*)': tmpxft_00007755_00000000-11_classInterpolationCuda.ii:(.text._Z10cudaLaunchIcE9cudaEr rorPT_[cudaError cudaLaunch<char>(char*)]+0x11): undefined reference to cudaLaunch’

Sorry, when I add -lcudart

I get following error

/usr/bin/ld: cannot find -lcudart

my bad, the makefile was having a somewhat hidden ’ -static’ option. sorry for posting this but should help others.