作者:文岚 | 来源:互联网 | 2023-02-05 09:50
编译一个程序,在链接时出现了问题如下所示,不知是哪里出了问题,请专家们解惑。谢谢了!1>------Buildstarted:Project:CUDA_cublasSgemm_e
编译一个程序,在链接时出现了问题如下所示,不知是哪里出了问题,请专家们解惑。谢谢了!
1>------ Build started: Project: CUDA_cublasSgemm_example, Configuration: Debug Win32 ------
1>Compiling...
1>CUDA_cublasSgemm_example.cu
1>tmpxft_00001db0_00000000-3_CUDA_cublasSgemm_example.cudafe1.gpu
1>tmpxft_00001db0_00000000-8_CUDA_cublasSgemm_example.cudafe2.gpu
1>tmpxft_00001db0_00000000-3_CUDA_cublasSgemm_example.cudafe1.cpp
1>tmpxft_00001db0_00000000-12_CUDA_cublasSgemm_example.ii
1>Linking...
1>CUDA_cublasSgemm_example.obj : error LNK2019: unresolved external symbol _cublasShutdown@0 referenced in function _main
1>CUDA_cublasSgemm_example.obj : error LNK2019: unresolved external symbol _cublasFree@4 referenced in function _main
1>CUDA_cublasSgemm_example.obj : error LNK2019: unresolved external symbol _cublasGetVector@24 referenced in function _main
1>CUDA_cublasSgemm_example.obj : error LNK2019: unresolved external symbol _cublasSgemm@52 referenced in function _main
1>CUDA_cublasSgemm_example.obj : error LNK2019: unresolved external symbol _cublasSetVector@24 referenced in function _main
1>CUDA_cublasSgemm_example.obj : error LNK2019: unresolved external symbol _cublasAlloc@12 referenced in function _main
1>CUDA_cublasSgemm_example.obj : error LNK2019: unresolved external symbol _cublasInit@0 referenced in function _main
1>D:\application program\test\CUDA_cublasSgemm_example\Debug\CUDA_cublasSgemm_example.exe : fatal error LNK1120: 7 unresolved externals
1>Build log was saved at "file://d:\application program\test\CUDA_cublasSgemm_example\CUDA_cublasSgemm_example\Debug\BuildLog.htm"
1>CUDA_cublasSgemm_example - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
3 个解决方案
在开头加上
#pragma comment(lib, "cublas.lib")
或者配置环境
在连接库中假如
“cublas.lib”
在CUDA_cublasSgemm_example.cu 开头加上
#pragma comment(lib, "cublas.lib")
或者配置环境
在连接库中假如
“cublas.lib”