Why do I receive a ' Error C1189 #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported!' error in the CUDA 'host_config.h' file when trying to compile CUDA code with GPU Coder?

32 views (last 30 days)
I am using MATLAB R2018a with GPU Coder. I have installed Visual Studio 2017 and CUDA 9.0, both of which are supported. When I try to compile any GPU Coder code, or run coder.checkGpuInstall('full'), I receive the following compiler error in a header, host_config.h:
ERROR: Error C1189 #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported!
What is going on?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 12 Nov 2024 at 0:00
Edited: MathWorks Support Team on 19 May 2021
The cause of this error is an update to Visual Studio 2017 that breaks support for CUDA.
Please note that Microsoft does not give users the ability to remove updates.
This is documented in the below CUDA Forum post:
The only solution is to install Visual Studio 2015 in some fashion. The easiest option is to install the Visual Studio 2015 Toolchain. You can do this by opening the Visual Studio Installer, selecting Modify, and selecting the Visual Studio 2015 toolchain.
You can also install the full version of Visual Studio 2015.
After doing this, make sure to change the compiler using 
mex -setup C ​mex -setup C++

More Answers (0)

Categories

Find more on Get Started with GPU Coder in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!