Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Using Clang configured with MSVC 2017 on Windows with QtCreator 4.3.1
QtWS25 Last Chance

Using Clang configured with MSVC 2017 on Windows with QtCreator 4.3.1

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 2.3k Views
  • 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.
  • A Offline
    A Offline
    aliaumem
    wrote on last edited by
    #1

    Hi,

    I've been trying to build my Qt application using Clang.
    It worked fine (mostly) while I was using it alongside MSVC 2015's standard library (by simply using the auto-detected "LLVM 64bit based on MSVC2015" compiler), however, I would like to use some of the new C++17 headers that were shipped with MSVC 2017 only.

    QtCreator does detect my installation of LLVM/Clang 3.9.1, but it insists on using it configured based on MSVC 2015, and I can't find a way to switch it to be based on MSVC 2017.

    I have desperatly been trying to manually add some compiler configuration that would allow me to do such a thing, but it seems that I can not set up the build environment properly.

    For instance, if my understanding is correct, MSVC ships a script called vcvarsall.bat to set all the build environment variables necessary, but I can't see any option in the manual configuration for a Clang compiler (or a custom compiler for that matter) to call that script. Even though the auto-detected LLVM clearly knows this script and uses the MSVC 2015 version of it!

    0_1499339785493_Qt_MSVC14_LLVM.jpg

    I would like to avoid manually changing the build environment variables (mostly the include and lib paths for the standard library) for each of my projects, if at all possible.

    NB: I also have installed Qt 5.9 binaries built with MSVC2017, and it builds fine with MSVC.

    I am quite puzzled by this issue, so if anyone can point me in the right direction, it would be very much appreciated!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SamirGfx
      wrote on last edited by
      #2

      Hi,

      I know that my reply is very late bu I have been using QtCreator with clang and vs2017 without problems.
      The way to do this is that first you need to run this script in a command prompt then start QtCreator within the same command prompt window
      that way Clang will be able to see all the header files and you will be able to create a new kit based on whatever clang version you are having.
      also note that you would most probably need to add clang manually as a c and c++ compiler plus creating a new kit based on that.
      finally in the created kit make sure that you use "win32-clang-msvc" as your mkspecs under "Qt mkspec" in the kit tab.

      Hope that helps.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved