As I wrote in the title. I cannot compile my program in VS 2022 beacuse of the cublasCreate() function. Below is my code and logs. This program is in the .cu file.
#include "cublas_v2.h"
#include "cuda_runtime.h"
int main()
{
cublasHandle_t handle;
cublasCreate(&handle);
return 0;
}
Build started...
1>------ Build started: Project: testy, Configuration: Debug x64 ------
1>Compiling CUDA source file kernel.cu...
1>
1>(directory)>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\include" -I"C:\Program Files (x86)\cpp 2023\Projekcik\vcpkg\installed\x64-windows\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart shared -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -Xcompiler "/Fdx64\Debug\vc143.pdb" -o (directory)\x64\Debug\kernel.cu.obj "(directory)\kernel.cu"
1>kernel.cu
1>tmpxft_00005160_00000000-7_kernel.cudafe1.cpp
1> Creating library (directory)\x64\Debug\testy.lib and object (directory)\x64\Debug\testy.exp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>kernel.cu.obj : error LNK2019: unresolved external symbol cublasCreate_v2 referenced in function main
1>(directory)\x64\Debug\testy.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "testy.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 23:22 and took 03,563 seconds ==========