Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Using Clang with Qt on Windows

    General and Desktop
    clang windows
    3
    6
    8109
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      walking.in.the.air last edited by

      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.

      What I've missed and how should I use Clang with Qt?

      1 Reply Last reply Reply Quote 0
      • T
        t3685 last edited by

        Hi,

        Did you check whether the clang kit was fully configured?
        Also, you probably need a qt libraries compiled with clang for this to work, do you have those? I can't recall whether they are available or not.

        W 1 Reply Last reply Reply Quote 1
        • W
          walking.in.the.air @t3685 last edited by

          @t3685 It seems that you're right - there is an empty "Qt version" field in Clang kit. To add this I need some qmake (don't know which).
          I haven't compiled anything. Why this should be done: Qt already have compiled dlls? Could you give some documentation for this - it would be great to understand the point.
          Thank you for help!

          1 Reply Last reply Reply Quote 0
          • T
            t3685 last edited by

            Hi,

            The qmake exe can be found in the Qt install folder of the SDK. From your answer I am assuming you don't have a lot of experience with C++. C++ applications can only use libraries built with the same compiler as the application. In your case you want to use clang so you need Qt libraries compiled with clang.
            Qt provides a number of versions of SDK for different compilers. You need to make sure that you downloaded the right one - if it exists.

            Greetings,

            t3685

            1 Reply Last reply Reply Quote 1
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              Hi and welcome to devnet,

              There's no pre-built package for Clang on Windows. I don't know if it would even be compatible with the MinGW version of Qt.

              So if you'd like to avoid Visual Studio, just download the MinGW Qt version. It's provided with MinGW so you don't have to download it from somewhere else.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply Reply Quote 2
              • W
                walking.in.the.air last edited by

                Yes, I'm newbie in C++ and didn't know the problem with different libraries and compilers. Now it is clear. Thank you very much!

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post