Results 1 to 15 of 15

Thread: Several problems on starting with QT (Creator)

  1. #1
    Join Date
    Aug 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Several problems on starting with QT (Creator)

    Hi,

    first of all I hope you can help me solving my problems or my short look at QT will be over very soon.
    In the past I've written my programs in Delphi. Now I want to have a look in C++ and the best and easiest way which I've found was QT, cause it's free

    After Installation I started the Creator, just to create a new blank project and tried to start it. But there the problems begin. If I create a new project, there are 2 problems:

    1.) If I save the project on another disc (Installed on C: - Project saved on D, the Makefile gets 'corrupted', so there isn't any drive letter like c:/programs/... etc., there is everything which leads to my installation path like

    Volume{Volume-ID}/path/to/qt

    So the compiler can't find anything he needs. If I change the paths by hand, it just resolves to my second problem.

    2.) For the second problem, I solved the issue above with just creating the project on the same disc device. There is no problem with the Makefile, but the compile didn't complete also, because of error message during the whole source. Just to remember: I've changed nothing, just created a new project.

    The first error is one that belongs to non existant file "ui_mainwindow.h". If I create it, the following errors are the same, I only get fixed this one (even if it's empty).

    Running build steps for project untitled1...

    Starting: "c:/programme/qt/qt/bin/qmake.exe" C:/Programme/QT/qt/untitled1/untitled1.pro -r -spec win32-g++

    debug_and_release.prf:1: Unknown test function: addExclusiveBuilds

    The process "c:/programme/qt/qt/bin/qmake.exe" exited normally.

    Starting: "C:/Programme/QT/mingw/bin/mingw32-make.exe" -w

    mingw32-make: Entering directory `C:/Programme/QT/qt/untitled1-build-desktop'

    g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\include\QtCore" -I"..\include\QtGui" -I"..\include" -I"..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"c:\Programme\QT\qt\untitled1-build-desktop" -I"c:\Programme\QT\qt\mkspecs\win32-g++" -o tmp\obj\debug_shared\main.o ..\untitled1\main.cpp

    g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\include\QtCore" -I"..\include\QtGui" -I"..\include" -I"..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"c:\Programme\QT\qt\untitled1-build-desktop" -I"c:\Programme\QT\qt\mkspecs\win32-g++" -o tmp\obj\debug_shared\mainwindow.o ..\untitled1\mainwindow.cpp

    ..\untitled1\mainwindow.cpp:2:27: error: ui_mainwindow.h: No such file or directory

    ..\untitled1\mainwindow.cpp: In constructor 'MainWindow::MainWindow(QWidget*)':

    ..\untitled1\mainwindow.cpp:6: error: invalid use of incomplete type 'struct Ui::MainWindow'

    ..\untitled1\/mainwindow.h:7: error: forward declaration of 'struct Ui::MainWindow'

    ..\untitled1\mainwindow.cpp:8: error: invalid use of incomplete type 'struct Ui::MainWindow'

    ..\untitled1\/mainwindow.h:7: error: forward declaration of 'struct Ui::MainWindow'

    ..\untitled1\mainwindow.cpp: In destructor 'virtual MainWindow::~MainWindow()':

    ..\untitled1\mainwindow.cpp:13: warning: possible problem detected in invocation of delete operator:

    ..\untitled1\mainwindow.cpp:13: warning: invalid use of incomplete type 'struct Ui::MainWindow'

    ..\untitled1\/mainwindow.h:7: warning: forward declaration of 'struct Ui::MainWindow'

    ..\untitled1\mainwindow.cpp:13: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.

    mingw32-make: Leaving directory `C:/Programme/QT/qt/untitled1-build-desktop'

    mingw32-make: *** [tmp/obj/debug_shared/mainwindow.o] Error 1

    The process "C:/Programme/QT/mingw/bin/mingw32-make.exe" exited with code %2.

    Error while building project untitled1 (target: Desktop)

    When executing build step 'Make'
    I'm quite new to C++ so I can't 'fix' this easy, just in fact, that I didn't changed anything and I just thought that a blank new project will start without any problems... I guess there is something wrong with my Installation, but I can't find a reason to prove this.

    Just to let you know about my environment:

    I've installed a Virtual Machine using VMWare. The OS is Windows XP Professional Service Pack 3 with all the latest Updates. I have 3 Virtual Discs, Disc 1 is C:, Disc 2 is D: and Disc 3 is a NTFS Folder at C:\Programme in which I have installed QT.

    I hope anyone could give me a hint how I can solve this issues, just to have a clean start and try to learn some basics and maybe write my first apps If there are any open questions, just ask.

  2. #2
    Join Date
    May 2010
    Posts
    24
    Thanked 8 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Several problems on starting with QT (Creator)

    Can you show the content of the file untitled1.pro ?

  3. #3
    Join Date
    Aug 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Several problems on starting with QT (Creator)

    Sure, here it is (as I said, it's default):

    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2010-08-16T11:29:08
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core gui
    8.  
    9. TARGET = untitled1
    10. TEMPLATE = app
    11.  
    12.  
    13. SOURCES += main.cpp\
    14. mainwindow.cpp
    15.  
    16. HEADERS += mainwindow.h
    17.  
    18. FORMS += mainwindow.ui
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Several problems on starting with QT (Creator)

    Via Build menu in Qt Creator try cleaning the project, running qmake and building the project again. Looks like you somehow messed your paths.
    I'm a rebel in the S.D.G.

  5. #5
    Join Date
    Aug 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Several problems on starting with QT (Creator)

    Hi,

    I tried your answer, but it doesn't change anything. Cleaning and qmake working fine, but if I try to start the app, it just fails with the errors above.

    I hope this can be fixed anyway, I thought it would just work out-of-the-box if I create a new project... I tried out the examples now, but it's the same there. I can't build any example, it stops with a huge amount of errors belonging to which example I choose. I installed it the usual way, I just edited the path to which QT should be installed, rest of the installation was default and should be as normal.

  6. #6
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Several problems on starting with QT (Creator)

    Is there ui_mainwindow.h somewhere in your source directory?
    I'm a rebel in the S.D.G.

  7. #7
    Join Date
    Aug 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Several problems on starting with QT (Creator)

    ... No there isn't. And I don't know why the Creator needs it, or includes it if it's not present. Just to clarify: This is the result of New Project->Default Settings->OK->Start. Nothing changed, nothing edited, nothing configured. Just out-of-the-box startup.

    And as I said above, even if I create this file, the errors posted in my first post won't be solved by that.

  8. #8
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Several problems on starting with QT (Creator)

    Quote Originally Posted by rockzOr View Post
    ... No there isn't. And I don't know why the Creator needs it, or includes it if it's not present.
    This file is a generated one. Qt Creator doesn't need this file, but your application does. Could you show the contents of the untitled1 directory?
    I'm a rebel in the S.D.G.

  9. #9
    Join Date
    Aug 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Several problems on starting with QT (Creator)

    There is no ui_mainwindow.h. And seriously, that's not the error I'm interested in. I can create this file on my own. The problems are still the same: Nothing works, not a clean, new project, not an example, nothing. If this file is generated, it's missing everywhere. If my application needs it (so *every* application which is newly created will need it - only with adjusted name), this is a bug. But even if this won't be, the error I quoted in my first post are still there.

    Again to clarify: My problem is, that even if I create a new, blank project, don't change anything after a fresh Installation of QT SDK package, nothing works, even the examples. If I create a new project and just want to start it after it's created to check if it works out-of-the-box and ignore this ui_mainwindow.h error, I still have these:

    Qt Code:
    1. ..\untitled1\mainwindow.cpp: In constructor 'MainWindow::MainWindow(QWidget*)':
    2. ..\untitled1\mainwindow.cpp:6: error: invalid use of incomplete type 'struct Ui::MainWindow'
    3. ..\untitled1\/mainwindow.h:7: error: forward declaration of 'struct Ui::MainWindow'
    4. ..\untitled1\mainwindow.cpp:8: error: invalid use of incomplete type 'struct Ui::MainWindow'
    5. ..\untitled1\/mainwindow.h:7: error: forward declaration of 'struct Ui::MainWindow'
    6. ..\untitled1\mainwindow.cpp: In destructor 'virtual MainWindow::~MainWindow()':
    7. ..\untitled1\mainwindow.cpp:13: warning: possible problem detected in invocation of delete operator:
    8. ..\untitled1\mainwindow.cpp:13: warning: invalid use of incomplete type 'struct Ui::MainWindow'
    9. ..\untitled1\/mainwindow.h:7: warning: forward declaration of 'struct Ui::MainWindow'
    10. ..\untitled1\mainwindow.cpp:13: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
    To copy to clipboard, switch view to plain text mode 

  10. #10
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Several problems on starting with QT (Creator)

    UI files are machine-generated files produced by Qt's MOC. Chances are high that if you're missing them, there's something wrong in your code. The first things to check for would be that you have derived (directly or indirectly) from QObject, and that you have included the QOBJECT macro in your class declaration.

    If that doesn't clear things up, post your source code.

  11. #11
    Join Date
    Aug 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Several problems on starting with QT (Creator)

    Really, I begin to start thinking that no one reads my posts... I don't have an own source code! I just create a NEW project and don't change anything. A complete NEW project with File->New project, nothing else. Even the examples, where the source code should be OK, because they are examples, doesn't work. The source code is default, standard created and yes, there is an QOBJECT inside the class declaration, it's the first line after class <Name> {...}.

    If there is anything unclear, I could provide screenshots, full code quote of the default created (...) and anything else, but please don't answer standard things which can't belong to my problem. If you don't know, say it and I give up.

  12. #12
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Several problems on starting with QT (Creator)

    Did you install the Qt SDK ?
    Can the moc program be found?

  13. #13
    Join Date
    Aug 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Several problems on starting with QT (Creator)

    Yes, I installed the complete SDK including the Creator from nokia.com.
    How can I check if moc can be found?

  14. #14
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Several problems on starting with QT (Creator)

    Does the qt installation directory contain moc (in the bin directory) ?

    Go to the console, but not in the qt installation dir, and type in moc. Does it get found?
    If not, your PATH environment variable needs to be set to your qt install dir/bin

  15. #15
    Join Date
    Aug 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Several problems on starting with QT (Creator)

    There is a moc.exe in the bin directory of QT, yes.

    If I type moc.exe in the console, it can't be found. So I edited my path to extend it with the QT install dir/bin.

    But if I want to start it than, I get this error:

    Qt Code:
    1. Could not find make command: mingw32-make.exe in the build environment
    2.  
    3. Error while building project untitled (target: Desktop)
    4.  
    5. When executing build step 'Make'
    To copy to clipboard, switch view to plain text mode 

    So I edited my PATH variable again to give it the path to mingw-make.exe.
    And after that, the same error occurs:

    Qt Code:
    1. Running build steps for project untitled...
    2.  
    3. Configuration unchanged, skipping qmake step.
    4.  
    5. Starting: "C:/Programme/QT/mingw/bin/mingw32-make.exe" -w
    6.  
    7. mingw32-make: Entering directory `C:/Programme/QT/qt/untitled-build-desktop'
    8.  
    9. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\include\QtCore" -I"..\include\QtGui" -I"..\include" -I"..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"c:\Programme\QT\qt\untitled-build-desktop" -I"c:\Programme\QT\qt\mkspecs\win32-g++" -o tmp\obj\debug_shared\mainwindow.o ..\untitled\mainwindow.cpp
    10.  
    11. ..\untitled\mainwindow.cpp:2:27: error: ui_mainwindow.h: No such file or directory
    12.  
    13. ..\untitled\mainwindow.cpp: In constructor 'MainWindow::MainWindow(QWidget*)':
    14.  
    15. ..\untitled\mainwindow.cpp:6: error: invalid use of incomplete type 'struct Ui::MainWindow'
    16.  
    17. ..\untitled\/mainwindow.h:7: error: forward declaration of 'struct Ui::MainWindow'
    18.  
    19. ..\untitled\mainwindow.cpp:8: error: invalid use of incomplete type 'struct Ui::MainWindow'
    20.  
    21. ..\untitled\/mainwindow.h:7: error: forward declaration of 'struct Ui::MainWindow'
    22.  
    23. ..\untitled\mainwindow.cpp: In destructor 'virtual MainWindow::~MainWindow()':
    24.  
    25. ..\untitled\mainwindow.cpp:13: warning: possible problem detected in invocation of delete operator:
    26.  
    27. ..\untitled\mainwindow.cpp:13: warning: invalid use of incomplete type 'struct Ui::MainWindow'
    28.  
    29. ..\untitled\/mainwindow.h:7: warning: forward declaration of 'struct Ui::MainWindow'
    30.  
    31. ..\untitled\mainwindow.cpp:13: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
    32.  
    33. mingw32-make: Leaving directory `C:/Programme/QT/qt/untitled-build-desktop'
    34.  
    35. mingw32-make: *** [tmp/obj/debug_shared/mainwindow.o] Error 1
    36.  
    37. The process "C:/Programme/QT/mingw/bin/mingw32-make.exe" exited with code %2.
    38.  
    39. Error while building project untitled (target: Desktop)
    40.  
    41. When executing build step 'Make'
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Problems starting a QtService using QtServiceController
    By Stiander in forum Qt Programming
    Replies: 3
    Last Post: 10th May 2011, 11:54
  2. Complie problems in using Qt Creator.
    By Zmrca in forum Installation and Deployment
    Replies: 4
    Last Post: 20th April 2010, 18:16
  3. Replies: 0
    Last Post: 12th October 2009, 23:37
  4. problems starting process
    By parsito in forum Qt Programming
    Replies: 8
    Last Post: 11th May 2007, 22:32
  5. Error starting Qt
    By shamik in forum Installation and Deployment
    Replies: 1
    Last Post: 18th April 2007, 13:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.