Compiling CUDA Projects in Visual Studio 2008 (Common Problems) Maintained by Pedram Ghodsnia ----------------------------------------------------------------------------------- Error: fatal error C1083: Cannot open include file: 'cutil_inline.h': No such file or directory Solution: 1- right-click on project name in solution explorer window 2- Click "Properties" 3- in left window Click Configuration Properties -> Linker 4- set the value of "Additional Library Directories" to "$(CUDA_PATH)/lib/$(PlatformName)";"$(NVSDKCOMPUTE_ROOT)/C/common/lib" 5- Right-click on your .cu file 6- Click Properties 7- Click on Cuda Runtime API 8- Set Additional Include Directories to : $(CUDA_PATH)/include;./;$(NVSDKCOMPUTE_ROOT)/C/common/inc;$(NVSDKCOMPUTE_ROOT)/shared/inc ------------------------------------------------------------------------------ Error: error LNK2019: unresolved external symbol / fatal error LNK1120: 2 unresolved externals Solution: 1- right-click on project name in solution explorer window 2- Click "Properties" 3- in left window Click Configuration Properties -> Linker -> Input 4- Set the value of Additional Dependencies to: cudart.lib cutil64D.lib 5- Click on Drop-Down box of "Win32" on top-center of the visial studio 6- Click on "Configure Manager" 7- click on Active solution platform drop-down 8- if X64 is in the list choose it, otherwise click on "New" 9- in "type or select the new platform" drop-box choose "x64" 10- Clicl Ok and make sure that x64 is selected. -------------------------------------------------------------------------- Error: fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64' Solution: 1- right-click on project name in solution explorer window 2- Click "Properties" 3- in left window Click Configuration Properties -> CUDA Runtime API -> Host 4- Set "Target Machine Platform" to "x64" 5- Click ok ---------------------------------------------------------------------------- Error: LINK : fatal error LNK1104: cannot open file 'cutil64D.lib' Solution: 1- right-click on project name in solution explorer window 2- Click "Properties" 3- in left window Click Configuration Properties -> Linker 4- set the value of "Additional Library Directories" to "$(CUDA_PATH)/lib/$(PlatformName)";"$(NVSDKCOMPUTE_ROOT)/C/common/lib" ----------------------------------------------------------------- Error: The program cannot start due to missing cutil64D.dll .... Solution: The problem can be solved using one of the following methods: A) Copy manually cutil64D.dll beside your generated exe file in YourProjectDirectory/x64/Debug directory B) Copy cutil64D.dll automatically by adding a post build event in setting of your project to do so you should : 1- right-click on project name in solution explorer window 2- Click "Properties" 3- in left window Click Configuration Properties -> Build Events -> PostBuild Event 4- Add this entry at the end of command line: copy "$(NVSDKCOMPUTE_ROOT)\C\bin\win64\$(ConfigurationName)\*.dll" "$(TargetDir)" ----------------------------------- Error: fatal error C1083: Cannot open include file: 'cublas_v2.h': No such file or directory Solution: 1- Right-click on your .cu file 2- Click Properties 3- Click on Cuda Runtime API 4- Set Additional Include Directories to : $(CUDA_PATH_v4_0)/include;./;$(NVSDKCOMPUTE_ROOT)/C/common/inc;$(NVSDKCOMPUTE_ROOT)/shared/inc;