6

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.

3
  • 1
    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. Commented Apr 20, 2018 at 18:44
  • 1
    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. Commented Apr 22, 2018 at 6:06
  • 2
    Unbelievable that this is still not working in Dec 2018, when VS 2017 is over 1.5 years old and VS 2019 is approaching. Commented Dec 17, 2018 at 1:53

5 Answers 5

5

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for your response. It would be helpful if you could provide the compiler path, make, path, and ABI information. Currently I am pointing my compiler to: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.13.26128\bin\Hostx64\x64\cl.exe.
A screenshot would be most helpful if anyone has been able to set this up manually...
i posted my last comment accidentally and can't edit it.. -> But I can't know precisely your ABI, you need to look in visual studio settings for that. All I can tell from your path is that it would be a 64 bits compiler... And I don't know which options are available for the ABI under windows. I guess visual studio should be there. Make path points to make.exe, and for C++ compiler should be g++.exe. Once you've added your custom compiler you also need to rebuild Qt with it from the source, and manually...
4

I have the same problem before. Then I install the BuildTools for 2017 as well. And now it works very well.

Maybe you can refer these:

https://forum.qt.io/topic/97693/qt-creator-4-8-not-detecting-vs-2017-in-kits

https://bugreports.qt.io/browse/QTCREATORBUG-17925?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&showAll=true

Comments

2

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.

Comments

0
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 Comment

While this code may solve the question, including an explanation of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please edit your answer to add explanations and give an indication of what limitations and assumptions apply.
-2

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.

1 Comment

Ofc you can, add whatever compiler you wish in the "Compilers" tab. Add whatever qmake you wish in the tab "Qt Versions" and combine them however you want in the "Kits" tab.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.