6

For studying the Qt book "C++-gui-programming-with-qt-4-2ndedition" I need command prompt of Qt. I've installed Qt 5.3.0 (creator 5.3.0 open source) but don't know where is its command prompt. Is there anyone to help me?

7
  • What "command prompt" do you want exactly ? There is no generic command prompt in Creator. There is the QML console for QML/JS debugging.
    – Leiaz
    Commented Jun 14, 2014 at 13:50
  • I don't know exactly. But the book says, from a command prompt .....
    – Aria
    Commented Jun 14, 2014 at 14:07
  • 1
    This means from cmd on Windows, or from a terminal on Linux.
    – Leiaz
    Commented Jun 14, 2014 at 14:16
  • But there should be a command prompt specific for Qt 5.3.0 apart from the Windows' one.
    – Aria
    Commented Jun 14, 2014 at 14:22
  • Why ? What command are you trying to execute ? (note: I don't use Windows, so perhaps you should edit your question with the specific problem you have, to get the attention of someone who does).
    – Leiaz
    Commented Jun 14, 2014 at 14:27

1 Answer 1

11

I think what you are seeking is a command prompt with an already setup environment (setting PATH variables for a certain Qt kit). You can find the appropriate batch file in QTINSTALLPATH/YOURKIT/bin/qtenv2.bat. You can e.g. start this batch inside your command shell.

This assumes that your are using a Windows install !

Please be aware that this only sets the environment for Qt ... not your compiler toolchain.

4
  • I'm using Win 7. The book says: From a command prompt change the directory to "MyProjectName" and then type: Qmake -project. I could to find that file in this path C:\Qt\Qt5.3.0\5.3\mingw482_32\bin. But what to do with that? Inside my command shell!? What is that? Sorry I'm so novice on Qt! PS: I've also installed Qt VS2012 on D:\ drive.
    – Aria
    Commented Jun 15, 2014 at 4:33
  • Ok ... i highly recommend that you take a look at the tutorial section of qt-project.org. I do not use the mingw kit but i will give you a brief step by step instruction in a few minutes when i got a coffee :-) Commented Jun 15, 2014 at 8:47
  • 1
    You need to start the command prompt with cmd. Now change the directory to C:\Qt\Qt5.3.0\5.3\mingw482_32\bin (i assume from your comments that this is your path. Now call the qtenv2.bat. This will setup your path (including your mingw compiler chain path if you installed it along with Qt). Now change to your project folder and try if you can call qmake and g++. Don't mix mingw and MVSC (visual studio compiler). These are totally different compilers and toolchains. Qt comes precompiled with different kits for different compilers. Choose the one you like (mingw or VS). Commented Jun 15, 2014 at 9:03
  • 1
    And just as a tip: I assume you are new to c++ programming, since you does not seem to understand the idea of compiler tool chains and so on. You should educate yourself first about the command line (that is pretty awful on Win using cmd - but this might be a matter of taste). Then choose a compiler tool chain (mingw of e.g. the MS solution). Make yourself familiar with setting up your environment (command line and IDE). Now - and this is the most important part - learn to program in c++. Without basic c++ knowledge you will never understand the concepts of the Qt framework. Commented Jun 15, 2014 at 9:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.