CUDA - linking errors with convolution example
I'm trying to compile the following code by Joe Stam (convol开发者_如何转开发utionapproaches, project with vs2005, I am using VS2010 but compiling with 9.0 engine)
1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol _cudaEventDestroy@4 referenced in function "float _cdecl NaiveGlobalConvolution(unsigned char *,unsigned char *,unsigned int,unsigned int,unsigned int,int,int)" (?NaiveGlobalConvolution@@YAMPAE0IIIHH@Z) 1>main.obj : error LNK2001: unresolved external symbol _cudaEventDestroy@4 1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol _cudaEventElapsedTime@12 referenced in function "float _cdecl NaiveGlobalConvolution(unsigned char *,unsigned char *,unsigned int,unsigned int,unsigned int,int,int)" (?NaiveGlobalConvolution@@YAMPAE0IIIHH@Z) 1>main.obj : error LNK2001: unresolved external symbol _cudaEventElapsedTime@12 1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol _cudaEventSynchronize@4 referenced in function "float _cdecl NaiveGlobalConvolution(unsigned char *,unsigned char *,unsigned int,unsigned int,unsigned int,int,int)" (?NaiveGlobalConvolution@@YAMPAE0IIIHH@Z) 1>main.obj : error LNK2001: unresolved external symbol _cudaEventSynchronize@4 1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol _cudaGetLastError@0 referenced in function "float _cdecl NaiveGlobalConvolution(unsigned char *,unsigned char *,unsigned int,unsigned int,unsigned int,int,int)" (?NaiveGlobalConvolution@@YAMPAE0IIIHH@Z) 1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol _cudaConfigureCall@32 referenced in function "float _cdecl NaiveGlobalConvolution(unsigned char *,unsigned char *,unsigned int,unsigned int,unsigned int,int,int)" (?NaiveGlobalConvolution@@YAMPAE0IIIHH@Z) 1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol _cudaEventRecord@8 referenced in function "float _cdecl NaiveGlobalConvolution(unsigned char *,unsigned char *,unsigned int,unsigned int,unsigned int,int,int)" (?NaiveGlobalConvolution@@YAMPAE0IIIHH@Z) 1>main.obj : error LNK2001: unresolved external symbol _cudaEventRecord@8 1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol _cudaEventCreate@4 referenced in function "float _cdecl NaiveGlobalConvolution(unsigned char *,unsigned char *,unsigned int,unsigned int,unsigned int,int,int)" (?NaiveGlobalConvolution@@YAMPAE0IIIHH@Z) 1>main.obj : error LNK2001: unresolved external symbol _cudaEventCreate@4 1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol _cudaMemset@12 referenced in function "float _cdecl NaiveGlobalConvolution(unsigned char *,unsigned char *,unsigned int,unsigned int,unsigned int,int,int)" (?NaiveGlobalConvolution@@YAMPAE0IIIHH@Z) 1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol _cudaSetupArgument@12 referenced in function "void _cdecl device_stub__Z28NaiveGlobalConvolutionKernelPhS_jjjf(unsigned char *,unsigned char *,unsigned int,unsigned int,unsigned int,float)" (?__device_stub__Z28NaiveGlobalConvolutionKernelPhS_jjjf@@YAXPAE0IIIM@Z) 1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol ___cudaRegisterVar@32 referenced in function "void _cdecl _sti_cudaRegisterAll_59_tmpxft_00000a3c_00000000_3_ConvolutionCudaFunctions_cpp1_ii_imgTex(void)" (?sti__cudaRegisterAll_59_tmpxft_00000a3c_00000000_3_ConvolutionCudaFunctions_cpp1_ii_imgTex@@YAXXZ) 1>ConvolutionCudaFunctions.obj : error LNK2019: unresolved external symbol ___cudaRegisterTexture@28 referenced in function "void _cdecl
... a lot of other errors...
1>Debug/ConvTest.exe : fatal error LNK1120: 35 unresolved externals
This with /MDd for code generation and CUDA C/C++ Runtime Host library.
If I switch to /MTd for both is the same.
What's wrong with this? I tried both the 32 bit and the 64 bit SDK, the toolkit is 6
There was a problem with 32/64 bit sdks, I solved by linking with the 32 bit
精彩评论