Qbs error: Could not start (no program defined)

  • I have installed Qt 5.9 (mingw-32-bit and msvc2017-64bit) with Qt Creator 4.3.0 and MingW 5.3.0 tool-chain. I do have VS 2017 installed and everything was auto-detected correctly. I also installed stand-alone CDB from Windows SDK 8.1.

    Qbs 1.8 that comes with Qt Creator created two kits - one for MinGW and the other for msvc2017. However only the former works and the latter gives me:

    Qbs error: Could not start (no program defined)

    when parsing the qbs file that was created by Qt Creator project wizard. By looking over the settings in Tools/Qbs I can see that while MinGW's kit has the toolchain set up for "cpp" module, the msvc does not. But I am a bit clueless as to what to set where so that it propagates into qbs toolkit.

    It is worth noting that Build&Kit tab gives me warning that I do not have any compilers set in CMAKE related paths for the msvc kit (even though MinGW once again has the same settings and produces no such error). I do not know where Qbs take the settings but if it takes them from the CMAKE settings in the kit(s) that might be an issue.

    Any advice how to setup Qbs with Qt Creator and Visual Studio 2017? Thank you.

  • And I will answer myself. Microsoft has moved Visual Studio 2017 tools to different location while Qt Creator is still looking for them according to the old layout.

    Old layout (VS 2015):
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\Tools\

    New layout (VS 2017):
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64

    Now in order to make Qbs work from Qt Creator you need to edit the generated kit in Tools/Qbs by settings there two variables (Edit->Add):

    cpp.compilerName to cl.exe
    cpp.toolchainInstallPath to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64

    Note that I use x64 native compiler on x64 host platform so you may want to use something else (e.g. x64 compiler on x86 system or vice versa) so you need to provide path to the toolchain you actually want to use.

Log in to reply