problems linking CURAND

After compiling, when i try to run my program using CURAND library, i got fallowing errors:

1>kernel.cu.obj : error LNK2019: unresolved external symbol _curandDestroyGenerator@4 referenced in function _main

1>kernel.cu.obj : error LNK2019: unresolved external symbol _curandGenerateUniform@12 referenced in function _main

1>kernel.cu.obj : error LNK2019: unresolved external symbol _curandSetPseudoRandomGeneratorSeed@12 referenced in function _main

1>kernel.cu.obj : error LNK2019: unresolved external symbol _curandCreateGenerator@8 referenced in function _main

1>C:\Users\NAIILO\Documents\Visual Studio 2010\Projects\curand_testy\Debug\curand_testy.exe : fatal error LNK1120: 4 unresolved externals

Yes, program is compiling succesfuly without any of them. Also ive declared all headers that are theoreticaly required to use curand library:

#include <stdio.h>

#include <stdlib.h>

#include <cuda.h>

#include <cuda_runtime_api.h>

#include <device_launch_parameters.h>

#include <curand.h>

#include <curand_kernel.h>

#include <curand_precalc.h>

Its example from CURAND Library.

Im using Visual Studio Ultimate 2010, with parallel Nsight.

Would be grateful for any sugestion, i cant move on with my work until i solve this.

Maybe some lib file is missed in linker options?

I have got the same problem , if you slove it ,please tell me how to deal with it , Thank you !!!

The issue here is that the curand library is not being properly added to the project as a link target.

This SO question describes generally what to do for the Visual Studio case:

http://stackoverflow.com/questions/13570285/how-to-link-library-e-g-cublas-cusparse-for-cuda-on-windows

Also note that if you are trying to do this in a 32bit project (win32 project) you are going to have trouble, because recent versions of CUDA don’t ship these libraries in 32-bit form anymore. The solution is to switch to a 64-bit project (x64)

Also, if you’re having trouble, it may be easier just to start with or clone one of the cuda sample projects that use CURAND.