Unresolved External Symbols when using CUDA Driver API VS2012

后端 未结 2 1596
萌比男神i
萌比男神i 2021-01-28 23:22

I\'ve been trying to use the CUDA driver API to load a .ptx file and a function from it with this code:

CUdevice device;
cuDeviceGet(&device,0);
CUcontext ct         


        
2条回答
  •  北恋
    北恋 (楼主)
    2021-01-28 23:41

    For those who does not know how to add cuda.lib into linking process like me (using VS2017):

    1. Right click on the project, goto Properties at the bottom of the menu

    2. Goto Linker-->Input

    3. In Additional Dependencies, make sure that cuda.lib is there. In my case, this solved the 2019 link error.

    4. Besides, if you click on the edit item in the drop menu, there is a Macros button that you can click and view all pre-defined Macros in your VS project.

提交回复
热议问题