CUDA - linking errors with convolution example

馋奶兔 提交于 2019-12-24 08:25:33

问题


I'm trying to compile the following code by Joe Stam (convolutionapproaches, 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


回答1:


There was a problem with 32/64 bit sdks, I solved by linking with the 32 bit



来源:https://stackoverflow.com/questions/5509796/cuda-linking-errors-with-convolution-example

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!