error LNK2019: unresolved external symbol using nvmex Problem wiht CUDA programs in Matlab

I have already read many guides and tutorial publised by NVIDIA or other publiser,I have been trying to use cuda in Matlab.I have faced so many problem in this process and I have succeed to solve all those problem.But now I am facing a new problem to compile Szeta.cu program or other Cuda programs.Following are the error message:

nvmex -f nvmexopts.bat Szeta.cu -IC:\cuda\include -LC:\cuda\lib
Szeta.cu
tmpxft_00000da8_00000000-3_Szeta.cudafe1.gpu
tmpxft_00000da8_00000000-8_Szeta.cudafe2.gpu
tmpxft_00000da8_00000000-3_Szeta.cudafe1.cpp
Microsoft ® Incremental Linker Version 8.00.50727.42
Copyright © Microsoft Corporation. All rights reserved.

Szeta.obj
Creating library C:\Users\HBEONG~1\AppData\Local\Temp\mex_346BE95F-60A6-4345-028C-856DE1E6D583\templib.x and object C:\Users\HBEONG~1\AppData\Local\Temp\mex_346BE95F-60A6-4345-028C-856DE1E6D583\templib.exp
Szeta.obj : error LNK2019: unresolved external symbol ___cudaUnregisterFatBinary@4 referenced in function ___cudaUnregisterBinaryUtil
Szeta.obj : error LNK2019: unresolved external symbol _cudaLaunch@4 referenced in function “enum cudaError __cdecl cudaLaunch(char *)” (??$cudaLaunch@D@@YA?AW4cudaError@@PAD@Z)
Szeta.obj : error LNK2019: unresolved external symbol _cudaSetupArgument@12 referenced in function ___device_stub__Z12real2complexPfP6float2i
Szeta.obj : error LNK2019: unresolved external symbol ___cudaRegisterFunction@40 referenced in function ___sti____cudaRegisterAll_40_tmpxft_00000da8_00000000_6_Szet
a_cpp1_ii_d098d4f8
Szeta.obj : error LNK2019: unresolved external symbol ___cudaRegisterFatBinary@4 referenced in function ___sti____cudaRegisterAll_40_tmpxft_00000da8_00000000_6_Szet
a_cpp1_ii_d098d4f8
Szeta.obj : error LNK2019: unresolved external symbol _cudaFree@4 referenced in function _mexFunction
Szeta.obj : error LNK2019: unresolved external symbol _cufftDestroy@4 referenced in function _mexFunction
Szeta.obj : error LNK2019: unresolved external symbol _cufftExecC2C@16 referenced in function _mexFunction
Szeta.obj : error LNK2019: unresolved external symbol _cufftPlan2d@16 referenced in function _mexFunction
Szeta.obj : error LNK2019: unresolved external symbol _cudaConfigureCall@32 referenced in function _mexFunction
Szeta.obj : error LNK2019: unresolved external symbol _cudaMemcpy@16 referenced in function _mexFunction
Szeta.obj : error LNK2019: unresolved external symbol _cudaMalloc@8 referenced in function _mexFunction
Szeta.mexw32 : fatal error LNK1120: 12 unresolved externals

C:\PROGRA~1\MATLAB71\BIN\NVMEX.PL: Error: Link of ‘Szeta.mexw32’ failed.

??? Error using ==> nvmex
Unable to complete successfully.

I understand this is a linker problem.I have no idea to solve it.
Following are Detail of my system:
1.window 2007 ulimate
2.Matlab version:7.1.0.246 (R14) Service Pack 3
3.cudatoolkit_2.3_win_32
4.cudasdk_2.3_win_32
5.Visual stdio 2005 express c++
Plz tell me I can I solve this problem?
Thanks in advance

Hi Monika

As far as I can see, you just supply a library path, but you don’t define the actual libraries you have want to link to your code. My compile instruction is a bit different from yours since I use vc++ to create a static library which I link to, but this is what I use:

nvmex -O -output cudaMex -Iinc -Lc:\cuda\lib -Ic:\cuda\include -lcuda -lcudart -LRelease -lcudaLib cudaMex.cpp

What you want to include in your project is the
-lcuda -lcudart

Where the first is a lowercase L. That will link the cuda.lib and cudart.lib file. Unless you want to use the dll’s, in which case I can’t help you.

Hope it works

/Henrik