Unresolved external symbols in beginners CUDA program

前端 未结 3 379
不知归路
不知归路 2020-12-05 05:31

I create a new Win32 Console App as an empty project I am running Windows 7 64bit with Visual Studio 2008 C++. I am trying to get the sample code from the bottom of this ar

相关标签:
3条回答
  • 2020-12-05 06:15

    In visual studio 2019:

    Double check the availability of CUDA_PATH environment variable.

    Configuration Properties -> VC++ Directories -> Include Directories -> Add $(CUDA_PATH)\include

    Configuration Properties -> VC++ Directories -> Library Directories -> Add $(CUDA_PATH)\lib\x64

    Configuration Properties -> Linker -> Input -> Additional Dependencies -> Add .lib files under $(CUDA_PATH)\lib\x64 and ignore existing .lib files.

    0 讨论(0)
  • 2020-12-05 06:21

    I guess you are missing to link to the correct library. Make sure you have the CUDA library added under "Configuration Properties->Linker->Input". Refer this.

    0 讨论(0)
  • 2020-12-05 06:29

    Two things are needed:

    1. Add CUDA path:
      Go: "Configuration Properties->Linker->General->Additional Libary Directories" and add $(CudaToolkitLibDir) to the list.

    2. Add CUDA runtime library:
      Go: "Solution Properties->Linker->Input->Additional Dependencies" and add cudart.lib to the list.

    0 讨论(0)
提交回复
热议问题