Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Cannot Run Compiler 'cl'
Forum Updated to NodeBB v4.3 + New Features

Cannot Run Compiler 'cl'

Scheduled Pinned Locked Moved Solved Installation and Deployment
22 Posts 6 Posters 50.1k Views 1 Watching
  • 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.
  • webzoidW webzoid

    @Brian-Dolan Thanks for your reply and thanks for the extra information. It got to the point where I uninstalled Qt AND Visual Studio then re-installed both just to see what would happen. When I re-installed Qt Creator, the same problems arose.

    It almost had me beat but after a little bit more digging, I've finally managed to sort it.

    When I executed the vcvarsall.bat file from within the Visual Studio / VC directory, I noticed that a couple of issues were being reported in the command line - notably that MySQL command not found which I thought rather odd - what would MySQL have to do with a Visual Studio install?

    Anyhoo, having then removed anything and everything MySQL-related from my system, running the vcvarsall.bat again yielded no reported issues. I then ran Qt Creator again using a simple example application and now everything works perfectly. All I can think of is that when the vcvarsall.bat returns an exit code, it was not the exit code expected by Qt Creator due to the MySQL issues. Either that or there was a lingering bath path around used by MySQL which no longer existed and was throwing the toolchain.

    Either way, I'm back in business! Thanks for all the comments and help with this.

    bokkiB Offline
    bokkiB Offline
    bokki
    wrote on last edited by
    #21

    @webzoid

    Thanks for your post! MySQL was also the culprit on my Qt build. I also installed all MySQL software and then I could build the Qt application without problems!

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kalb88
      wrote on last edited by
      #22

      In my case it was more complex. The antivirus client was tripping up over all the reg query calls in some of the bat files and delaying things sufficiently such that Qt got an incomplete environment. Seems Qt times out when calling vcvarsall. The delays were substantial. Minutes. Observed Qt creating temp bat files to call vcvarsall.bat over and over and over again. The solution I arrived at is to cache the resulting environment in another .bat file that simply sets the environment variables with the determined values. This is updated 1x day and the result is that I can open in Qt and have a working environment. It simply sets the saved environment and skips all the reg query calls. Note that vcvars64 or vcvars32 both make a reg query call for VS140COMNTOOLS. This seems enough of a delay to result in an incomplete path and hence cl.exe missing. I setup the caching within the vcvars64/32 files. If the cache file exists for the day then it's simply loaded, otherwise the reg query process is done to populate the values in case the environment changes and then those variables are written to the cache cmd file.

      The other bit of fun is that the order of reg query calls isn't optimized for current systems, meaning it tries several failing paths first, also adding to delay. And most every line in called bat files is prepended with @ (echo off) making debugging harder. That and the subroutines called have > null 2>&1 which also turns off output. So if you need to debug you need to deal with all that. Noticed 2017 bats have two branches of code to allow for debugging.

      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