CUDA Version: v9.2
When I compiled a sample named “vectorAdd”, it occurs an error with message:
C1189 #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported! vectorAdd c:\program files\nvidia gpu computing toolkit\cuda\v9.2\include\crt\host_config.h 133
It’s the file
host_config.h who has limited the version. So we can change the version limit in this file:
131 #if _MSC_VER < 1600 || _MSC_VER > 1913
131 #if _MSC_VER < 1600 || _MSC_VER > 1920
It depends on your Visual Studio version that which version should you indicate, which means that probably
_MSC_VER > 19xx is written in your
host_config.h, while your actual
_MSC_VER could also be greater than 1920. It’s all up to your situation, the principle is to modify the limit, you’ve got it!
For another error:
If we open an individual sample in the grand project, it will occur another problem.
The message shows that all the head files for CUDA have not been added. So we can add them manually: Right click on the
solution->Properties->VC++ Directories->include path, add
"C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\common\inc;" (which is your CUDA head files directory).
All will be well. God bless you!