Project ERROR: Cannot run compiler 'clang++'. Output

  • I get the following error and Im unsure how to resolve the issue.

    Project ERROR: Cannot run compiler 'clang++'. Output:

    Maybe you forgot to setup the environment?
    23:34:44: The process "/home/jarel/Qt/5.12.1/gcc_64/bin/qmake" exited with code 3.
    Error while building/deploying project untitled (kit: Desktop Qt 5.12.1 GCC 64bit)
    When executing step "qmake"

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What OS are you running ?
    What compilers did you install ?
    How did you configure Qt to use clang in place of gcc ?

  • Hello

    Im running OpenSUSE Leap 15

    for the last question, I hope ill answer it the correct way. Im not sure how I configured it. I just installed Qt creator and when I tried to create a new project, I seen the error message

  • Lifetime Qt Champion

    Then you should check your Kit.

    How did you install Qt ?

  • Lifetime Qt Champion

    @jarelsanders1986 Is there a reason why you're using RC1 of the QtCreator?
    Do you need Clang? If not you can use GCC which is default on Linux.

  • I had exactly the same issue on Ubuntu "18.04.2 LTS". I solved the problem by installing clang:

    ~$ sudo apt install clang

  • @Castro88

    I had the exact the same project parsing error on Qt 5.12.3 and Kubuntu 18.04.2 LTS and solved it an easier way (since in the OP's case, he wouldn't need sudo rights for the symlink):

    $ cd /home/jarel/Qt/5.12.1/Tools/QtCreator/libexec/qtcreator/clang/bin
    $ ln -sf clang-7 clang++

  • Lifetime Qt Champion

    @greensh Hi and welcome to devnet,

    That's not a solution. Install the clang package but don't mix the tools used by creator with the one provided by your distribution.

  • @SGaist

    From reading about the latest clang changes in QtCreator, see comments section at:

    it's presumed the preferred Qt method is to use their integrated Clang version with QtCreator, rather than using a mismatched system version with QtCreator's Clang plugins. It's also presumed that QtCreator 4.9.0 should compile C++ code out-of-the-box on Ubuntu with only the system build-essential installed (which only includes the GCC toolchain).

    Can you provide any Qt documentation to support this not being a solution or the Qt preferred way?

  • Lifetime Qt Champion

    Qt Creator is an IDE, it doesn't provide compiler support. Providing compilers is the role of your OS.

    The fact that the clang executable can be found in Qt Creator is an implementation detail because Qt Creator uses clang infrastructure for some of it plugins.

    Do not presume things like that. If there was any recommendation to use the clang version Qt Creator uses internally, that would be documented.

  • HI, I have solved the same problem in Ubuntu 18 just by installing qt creator from the repository. In my case it was:

     sudo apt-get install qtcreator

    This will install all necessary package by itself and then you can run your currently installed version, as this command, unfortunately, doesn't show docs and examples (in my case).

  • Hello
    I'm working under Debian Os (bullseye) and i've face the same probleme while runing an existing project "clock", any idea how to fixe this ?

  • Solution:
    Use the gcc compiler instead of clang++.

Log in to reply