5
votes

I have Qt creator 4.6.0 and Microsoft Visual Studio 2017 Enterprise installed on my system. Through Visual Studio, I have installed "Desktop development with C++" including VC++ 2017 v141 tool set.

When trying to configure the MSVC 2017 64 Kit in Qt Creator, the MSVC compiler is not auto-detected. The only compilers that show are MinGw and Visual Studio 2008 (9.0) I believe I should be seeing "Microsoft Visual C++ Compiler 15.0".

Does anyone know how I can get the compiler to auto detect or add this manually. I can compile and build QT programs in Visual Studio, but would like to use QT Creator.

Thanks in advance.

5
I have tried installing/reinstalling to no avail. I suspect there is an issue with my Visual Studio setup, but I have no clue what it could be.Michael Japzon
There's no issue with your Visual Studio setup. Qt Creator's compiler detection is not complete. You'll need to build your own copy of Qt Creator and fix it in the sources, and ideally submit a patch to Qt Project.Kuba hasn't forgotten Monica
Unbelievable that this is still not working in Dec 2018, when VS 2017 is over 1.5 years old and VS 2019 is approaching.Ela782

5 Answers

6
votes

You have to add it manually then. In the Build & Run settings, compiler tab, click add, custom -> C++, then fill the compiler line with the compiler's path.

But you have to fill correctly the ABI line, and if it doesn't fit any Qt build you already made, then you will have to build Qt from source again from a msvc command prompt.

2
votes

I had a similar problem, it got it working by installing Visual Studio 2017 with Chocolatey like this:

choco install visualstudio2017community
choco install visualstudio2017-workload-nativedesktop

And after that Qt Creator 4.9 could detect the MSVC2017 compiler without issues.

0
votes
REM *************************************************************************
REM ** SETTING DEVELOPMENT ENVIRONMENT
REM ** - Visual Studio
REM ** - Qt
REM *************************************************************************

D:
cd \svn\trunk
call C:\Qt\5.15.0\msvc2019_64\bin\qtenv2.bat
cmd /K "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
-1
votes

You can't manually add MSVC to Qt Creator. If you want to use it make sure to have the correct Visual Studio version installed.

Try reinstalling Visual Studio if the MSVC compiler don't appear in the Compilers tab.