Important: Please read the Qt Code of Conduct -

Running qmake and nmake commands

  • In order to run a .bat file that has the commands-
    qmake.exe -r -spec win32-msvc2013++ "CONFIG+=release"
    Do i have to have Qt creator installed on my computer or its enough to have qt libraries and dlls copied (of msvc2013) and debugging tools for windows?

  • Moderators

    You do not need Qt Creator, it is "just" an IDE. qmake.exe is part of Qt libraries (located in qtbase/bin).

  • Thank you!

    I copied the libraries of msvc2013_64_opengl to be in the location:


    I set the environment variables to be:

    @QTDIR = D:\Qt5.3.0\5.3\msvc2013_64_opengl
    QMAKESPEC = win32-msvc2013
    PATH = %PATH%;%QTDIR%\bin

    When I open the command line and run the command:
    qmake.exe -r -spec win32-msvc2013++ "CONFIG+=release"

    I get the error:
    'qmake.exe' is not recognized as an internal or external command.

    How can I solve it?
    Is there anything else I need to do in order to run the qmake command?
    like- configure something, install Qt version...
    If so, how exactly should I do it?

  • Moderators

    If you decide to copy Qt libraries, you are going to have trouble. Those can be solved, but it will definitely be painful. It's usually better to compile Qt on your own, or install the Qt package in a new location. Qt lib move can be made with help of a qt.conf file. You can search for more info on that in the documentation.

    Now, qmake is missing from your path, because you set it up wrongly. qmake.exe resides in <qt dir>/qtbase/bin.

  • Where? I don't see it. Inside qt dir that is: D:\Qt5.3.0\5.3\msvc2013_64_opengl
    I see only: bin, imports, include, lib, mkspecs, phrasebooks, plugins, qml, translations.
    (Meanwhile I want to try with out compiling Qt by my own or installing Qt on the PC I moving my project to)

  • Moderators

    Well. Then, perhaps, just look around? Somewhere in your Qt installation folder, you will find a folder named qtbase, and it will contain a directory bin, and inside it, qmake.exe will be present. Ten just point PATH to there.

    I don't normally use Qt installers, so I don't know exact path inside the installed bundle. I know it for Qt built from source, and that is what I have provided.

  • Well. I searched around and there is no qtbase folder.

  • Moderators

    Have you checked whether qmake.exe is in "bin" folder? It has to be somewhere.

  • Yes. as I wrote at the beginning qmake.exe is at the location I put in the path: D:\Qt5.3.0\5.3\msvc2013_64_opengl\bin.
    but I still then get the error: ‘qmake.exe’ is not recognized as an internal or external command.

  • Moderators

    Oh, you did, indeed. I have missed or misunderstood that part.

    Try cd'ing into QTDIR/bin and see if you can launch qmake from there. Maybe it is enough to skip .exe from the call (so, run qmake -v instead of qmake.exe -v). It's been a while since I launched qmake on Windows manually. Linux tends to be simpler to use in that regard.

  • OK. I did so. Now it works well. but how can I make it work with out cd'ing to D:\Qt5.3.0\5.3\msvc2013_64_opengl\bin.

  • Moderators

    You have already done that: by setting PATH (which on Windows is enclosed in percentage signs, of course) in the control panel.

  • But if I am not launching qmake from D:\Qt5.3.0\5.3\msvc2013_64_opengl\bin I get the error: ‘qmake.exe’ is not recognized as an internal or external command.

  • Moderators

    Make sure path is defined in your terminal by running this:
    echo %path%

Log in to reply