Qt World Summit: Register Today!

Qt Creator Problem with Getting Started Tutorial

  • Hi!

    I was just trying to run the "Hello Notepad" application of the GettingStarted Tutorial ("http://doc.qt.nokia.com/4.7/gettingstartedqt.html":http://doc.qt.nokia.com/4.7/gettingstartedqt.html), but it doesn't work.

    I did the following steps:

    I downloaded the latest QT SDK for Windows (1.2.1) and installed the QT SDK on my Computer. I went through some of the tutorials on Installation and Project Administration and then I wanted to run the "Hello Notepad" example of the Getting-Started Tutorial.

    So I opended the C++ File of the part1 folder with the QT Creater. However, the debugging buttons were deactivated, so I could not debug and run the apllication.

    Then I opened the gsQT.pro file of the main folder of the tutorial folders (part1 - part5) and tried to debug and run it. However the tool said something like "could not find the .pro files in the part1 (...part5) folders. Then I looked into these folders via the Windwos Explorer and I found only the C++ source files in part1, part2, part3, part4, part5 folders but no .pro files :-(

    What do I do wrong? I have completed several projects with php or C++ (Visual Studio) but I am afraid I cannot run the most simple example of the GettingStarted tutorial...

    Can anyone help or explain what to do to run the examples of the tutorial?

    Cheers, Toby

  • By the way, this is the message I receive when I open the gsQT.pro file trying to debug:

    bq. 12:54:53: Führe Build-Schritte für Projekt gsqt aus...
    12:54:53: Starte "c:\qtsdk\desktop\qt\4.8.1\msvc2010\bin\qmake.exe" C:\QtSDK\Examples\4.7\tutorials\gettingStarted\gsQt\gsqt.pro -r -spec win32-msvc2010 "CONFIG+=declarative_debug"
    Reading C:/QtSDK/Examples/4.7/tutorials/gettingStarted/gsQt/part1/part1.pro [C:/QtSDK/Examples/4.7/tutorials/gettingStarted/gsqt-build-desktop-Qt_4_8_1_for_Desktop_-MSVC2010__Qt_SDK__Debug/part1]
    Reading C:/QtSDK/Examples/4.7/tutorials/gettingStarted/gsQt/part2/part2.pro [C:/QtSDK/Examples/4.7/tutorials/gettingStarted/gsqt-build-desktop-Qt_4_8_1_for_Desktop
    Reading C:/QtSDK/Examples/4.7/tutorials/gettingStarted/gsQt/part3 [C:/QtSDK/Examples/4.7/tutorials/gettingStarted/gsqt-build-desktop-Qt_4_8_1_for_Desktop
    Reading C:/QtSDK/Examples/4.7/tutorials/gettingStarted/gsQt/part4/part4.pro [C:/QtSDK/Examples/4.7/tutorials/gettingStarted/gsqt-build-desktop-Qt_4_8_1_for_Desktop
    Reading C:/QtSDK/Examples/4.7/tutorials/gettingStarted/gsQt/part5/part5.pro [C:/QtSDK/Examples/4.7/tutorials/gettingStarted/gsqt-build-desktop-Qt_4_8_1_for_Desktop
    12:54:53: Der Prozess "c:\qtsdk\desktop\qt\4.8.1\msvc2010\bin\qmake.exe" wurde mit dem Rückgabewert 3 beendet.
    Fehler beim Erstellen des Projekts gsqt(Ziel: Desktop)
    Bei der Ausführung von Build-Schritt 'qmake'

  • you can generate the .pro files by running <path-to-example-directory>\qmake -project for each folder (you will need to edit the PATH environment variable to let the OS know about qmake...alternatively, you can copy qmake.exe to the folder...it is in the bin folder of the SDK)
    EDIT-didn't read your second post...could you translate that?

  • Hi raaghuu,

    thank you very much for your answer!!!

    The translation is:
    bq. line 1: Building Project gsqt...
    line 2: Starting....
    12:54:53 The process "c:\qtsdk\desktop\qt\4.8.1\msvc2010\bin\qmake.exe” was terminated with return value 3
    Error when creating the project gsqt /target: desktop)
    When executing build-step "qmake"

    Once again in details:
    I opened the c++ file (just this file) with the qt creater and I could not debug an run it. I assume it is because it is not a project but just a c++ file, right?

    So I opened the gsqt.pro file (just this file) and tried to debug and run. The result is the error message above. I tried to open a command prompt (see tutorial) by right-clicking the the gsqt.pro file in the left window of the qt creater and I entered several commands like "qmake -project" etc but the command prompt window then return "wrong spelling or could not find it" but it is the right path...
    How can I change the PATH environment variable in QT Creater?

    Could you maybe explain which file of the tutorial I should open with qt Creater and what I should do then to run the project? I tried to solve the problem for 2 days not, without success... :-(

    Cheers, Toby

    EDIT: I could not find the qmake.exe in the bin folder of the SDK. I looked into QtSDK\QTCreater\bin. There are several files and folders but there is no qmake.exe...

    EDIT: Maybe it is best if someone could really help me by describing each step in detail (this is exactly whta is not in the getting started tutorial). Which file should I open, what configurations hsould I make to run the first example of the getting started tutorial. I'm sure I am doing something wrong but I'm quite confused now after trying so many things...

  • there should be something like Qt 4.8.0 for Desktop (MinGW) with a command prompt icon in the start menu folder of Qt(not minGW since you use VS)...use that one...it sets the env. itself...from there you need to go to the examples directory you want to run and then use qmake -project there to create the .pro file...as you said there were no .pro files in the folders and return code 3 means file/path not found...so basically, qmake is unable to find the .pro files and hence the build fail... you need to create the .pro files for the individual examples first...that's what i think is the problem...btw your qmake is here c:\qtsdk\desktop\qt\4.8.1\msvc2010\bin\qmake.exe

    EDIT- i just did the same myself...the examples are working...although you'll have to run each .pro file seperately(not the gsqt.pro but the individual .pro files in each folder)

  • Hi Raaghuu,

    thanks for your reply. I'm so cinfused right now that I could not follow your instructions... Could you maybe help me from the beginning? I know it sound sstrange, but I tried it for 2 days now and I am sure it could be solved easily.

    This is the situation:
    I downloaded and installed the QT SDK 1.2.1 on my computer (Windows 7) form this page: "Link":http://qt.nokia.com/downloads/downloads#qt-other

    I downloaded and installed the QT libraries form this site: "Link":http://qt.nokia.com/downloads/windows-cpp-vs2010

    EDIT: These are the available folders on my harddrive C:




    Now, I want to open the first example (part1) of the Getting Started Tutorial ("here":http://doc.qt.nokia.com/4.7/gettingstartedqt.html)

    What exactly do I have to do now?

    Thanks in advance!!!!


  • Ok, I found the solution myself, however I don't understand it...

    If I open the folder part1 of C\QT (the installation of the libraries -> see above), there is also a qt project file in the part1 folder. If I double click it, QT Creater opens and every thing is ok.

    If I open the folder part1 of the C\QTSDK (the installation of the SDK -> see above), there is no qt project file in the part1 folder.

    When initially posting here about the problem, I had only tried to open the part1 example via the SDK installation folders -> didn't work.

    Now I found out, that the same examples are also available in the QT libraries instalation, providing qtproject files in each of the folders (part1 - part5) without having compiled or tested anything before.

    Is it a bug of the SDK Installation that the part1 to part5 folders to not contain the project files of the examples? Does anyone know?

    I'm so happ, finally I can proceed....

    Cheers Toby

  • well my SDK installation also didn't have the .pro files initially..so i guess that's same for all...
    you didn't need to install the libraries coz they are included in the SDK...the seperate libraries are used if you are using some other IDE than Qt Creator(like Eclipse)or if you try to build the static version of Qt...
    neways...its not that diff to generate the .pro files in the SDK version...what exactly confused you?

  • I just don't understand how to generate the .pro files because I tried so many ways and commands...

    What exactly do you do after opening the gsqt.pro file of the QTSDK/examples/version/tutorials/gettingStarted/gsQt folder with the QT Creater SDK?

    At this point, the folder QTSDK/examples/version/tutorials/gettingStarted/gsQt contains 5 folders (part1, part2, part3, part4, part5) each with a cpp-source file in it and the folder contains the gsQt.pro - file. Now the double click on the .pro file, the qt creater opens and displays the .pro file:

    @TEMPLATE = subdirs

    SUBDIRS = part1


    sources.files = *.pro
    sources.path = $$[QT_INSTALL_EXAMPLES]/tutorials/gettingStarted/gsQt
    INSTALLS += sources@

    On the left side, there is a window which displays the project and its files. At this time, only the gsqt.pro file is displayed. This sounds logic, as I doubleclicked only the pro file and didn't do anything else. So what is the next step?


    Or is it even wrong to double click the pro file? Should I double click the c++ source file in the part1 folder? And what comes next?

  • you don't need to open Creator for creating .pro files of existing .cpp files...
    open the windows command prompt(not through Qt Creator, but by pressing the <windows key>+r to open the run dialog box and typing cmd.exe and pressing ok for win Xp...in win7 simply press the <windows key> and use the search option in it to find cmd.exe)then execute the following commands:

    cd <path-to-example-directory> --press enter-- (the path is until the part1/2/3 folder -
    c:\qtsdk\desktop\qt\4.8.1\msvc2010\bin\qmake.exe -project press enter

    now you will see a .pro file has been created in that folder(like it was in the examples folder where you installed the libraries)

    p.s. - it should also work in the qt creator command prompt

    p.p.s. - <windows key> refers to the one between left ctrl and left alt on the keyboard(which opens the start menu)

Log in to reply