C++ – How to use Clang as a compiler with Qt Creator on Windows

cclangllvmqtqt-creator

I've installed Qt SDK with Qt Creator on my Windows 7. LLVM & Clang installed as well. CMake was already installed. Afterwards added Clang as a compiler into:
Tools -> Options… -> Build & Run -> Compilers

Then I've created Clang kit. However while creating new project (simple console application) I've no ability to choose Clang kit. There are only autodetected MSVC kits.

Maybe the problem is that "Qt version" in Clang kit is empty. But where to get qmake for it?

Best Answer

You should also have an appropriate compiled Qt library with Clang. There is no Clang build of Qt for Windows in the download page. So you have to prepare the build environment on your machine and compile the Qt source and then assign the qmake binary path in the "Qt version" field of your kit. Or simply use another compiler the Qt binary builds for which is already present at the download page.

Related Topic