Results 1 to 8 of 8

Thread: Need help installing.

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Need help installing.

    http://www.sortinonline.it/download/...T4_Dev-C++.zip

    I have followed the instructions in the file above, but I've missed something. I either get "missing reference vtable for MainWindow" if I try to create the simple easy default project that you get with each new project.
    If I try to compile an old working project it complains about missing members. Oh. I'll try to send more information tomorrow, but if someone has any better method of integrating Dev-C++ and Qt 4.1 open source, please report them.

  2. #2
    Join Date
    Jan 2006
    Location
    N.B. Canada
    Posts
    47
    Thanked 8 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need help installing.

    I have followed the instructions in the file above, but I've missed something. I either get "missing reference vtable for MainWindow" if I try to create the simple easy default project that you get with each new project.
    Make sure you are using Q_OBJECT macro in your class declaration. If you are, then something is going wrong with building, and moc isn't run, or isn't run correctly. As I don't use Dev-C++, I can't really help you. Look into the .pro file, and maybe post it here. Also, post the code too.

    If I try to compile an old working project it complains about missing members.
    What do you mean by an "old" and "working"? If it's Qt3 than it wont work with Qt4. Is it Qt4, and works when you build it from command line, but doesn't work when built from the Dev-C++ environment? What are the exact errors, and the offending code? This could be a completely unrelated problem.

    Oh. I'll try to send more information tomorrow, but if someone has any better method of integrating Dev-C++ and Qt 4.1 open source, please report them.
    Can't help you directly with that, as I don't use Dev-C++. qmake + make works for me.

    Bojan
    Last edited by Bojan; 22nd February 2006 at 01:07.
    The march of progress:
    C:
    printf("%10.2f", x);
    C++:
    cout << setw(10) << setprecision(2) << showpoint << x;
    Java:
    java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
    formatter.setMinimumFractionDigits(2);
    formatter.setMaximumFractionDigits(2);
    String s = formatter.format(x);
    for (int i = s.length(); i < 10; i++) System.out.print(' ');
    System.out.print(s);

  3. #3
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need help installing. (Dev-C++)

    Here is the code that doesn't work:

    main.cpp
    Qt Code:
    1. #include <QApplication>
    2.  
    3. #include "mainwindow.h"
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc, argv);
    8. MainWindow *MainForm = new MainWindow;
    9. MainForm->show();
    10. return app.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 
    mainwindow.h
    Qt Code:
    1. #ifndef MAINWINDOW_H
    2. #define MAINWINDOW_H
    3.  
    4. #include <QMainWindow>
    5. #include "mainwindow_ui.h"
    6.  
    7. class MainWindow : public QMainWindow
    8. {
    9. Q_OBJECT
    10. public:
    11. MainWindow(QWidget * parent = 0);
    12. private:
    13. Ui::MainWindow ui;
    14. };
    15.  
    16. #endif
    To copy to clipboard, switch view to plain text mode 
    mainwindow.cpp
    Qt Code:
    1. #include <QtGui>
    2.  
    3. #include "mainwindow.h"
    4.  
    5. MainWindow::MainWindow(QWidget *parent)
    6. : QMainWindow(parent, 0)
    7. {
    8. ui.setupUi(this);
    9. }
    To copy to clipboard, switch view to plain text mode 
    mainwindow.ui
    Qt Code:
    1. <ui version="4.0" >
    2. <author></author>
    3. <comment></comment>
    4. <exportmacro></exportmacro>
    5. <class>MainWindow</class>
    6. <widget class="QMainWindow" name="MainWindow" >
    7. <property name="geometry" >
    8. <rect>
    9. <x>0</x>
    10. <y>0</y>
    11. <width>425</width>
    12. <height>248</height>
    13. </rect>
    14. </property>
    15. <property name="windowTitle" >
    16. <string>Test QT DevCPP</string>
    17. </property>
    18. <widget class="QWidget" name="centralWidget" />
    19. </widget>
    20. <pixmapfunction></pixmapfunction>
    21. <resources/>
    22. <connections/>
    23. </ui>
    To copy to clipboard, switch view to plain text mode 

    And here is the compile errors
    Qt Code:
    1. Compiler: Qt
    2. Building Makefile: "E:\slask\Qt1\Makefile.win"
    3. Executing make clean
    4. rm -f mainwindow.o main.o mainwindow_moc.o Project1.exe
    5. g++.exe -c mainwindow.cpp -o mainwindow.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Qt/4.1.0/include" -I"C:/Qt/4.1.0/include/QtGui" -I"C:/Qt/4.1.0/include/Qt" -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt/4.1.0/include/QtDesigner" -I"C:/Qt/4.1.0/include/QtNetwork" -I"C:/Qt/4.1.0/include/QtUiTools" -I"C:/Qt/4.1.0/mkspecs/win32-g++" -I"C:/QT/4.1.0/mkspecs/win32-g++" -I"C:/QT/4.1.0/include" -DWIN32 -ansi -fexceptions
    6. g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Qt/4.1.0/include" -I"C:/Qt/4.1.0/include/QtGui" -I"C:/Qt/4.1.0/include/Qt" -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt/4.1.0/include/QtDesigner" -I"C:/Qt/4.1.0/include/QtNetwork" -I"C:/Qt/4.1.0/include/QtUiTools" -I"C:/Qt/4.1.0/mkspecs/win32-g++" -I"C:/QT/4.1.0/mkspecs/win32-g++" -I"C:/QT/4.1.0/include" -DWIN32 -ansi -fexceptions
    7. g++.exe -c mainwindow_moc.cpp -o mainwindow_moc.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Qt/4.1.0/include" -I"C:/Qt/4.1.0/include/QtGui" -I"C:/Qt/4.1.0/include/Qt" -I"C:/Qt/4.1.0/include/QtCore" -I"C:/Qt/4.1.0/include/QtDesigner" -I"C:/Qt/4.1.0/include/QtNetwork" -I"C:/Qt/4.1.0/include/QtUiTools" -I"C:/Qt/4.1.0/mkspecs/win32-g++" -I"C:/QT/4.1.0/mkspecs/win32-g++" -I"C:/QT/4.1.0/include" -DWIN32 -ansi -fexceptions
    8. g++.exe mainwindow.o main.o mainwindow_moc.o -o "Project1.exe" -L"C:/Dev-Cpp/lib" -L"C:/Qt/4.1.0/lib" -L"C:/QT/4.1.0/lib" -lmingw32 -lqtmain -lQtCore4 -lQtGui4
    9. mainwindow.o(.text+0x16f):mainwindow.cpp: undefined reference to `vtable for MainWindow'
    10. mainwindow.o(.text+0x17b):mainwindow.cpp: undefined reference to `vtable for MainWindow'
    11. mainwindow.o(.text+0x25b):mainwindow.cpp: undefined reference to `vtable for MainWindow'
    12. mainwindow.o(.text+0x267):mainwindow.cpp: undefined reference to `vtable for MainWindow'
    13. collect2: ld returned 1 exit status
    14. make.exe: *** [Project1.exe] Error 1
    15. Execution terminated
    To copy to clipboard, switch view to plain text mode 

    I have followed these instructions
    http://www.sortinonline.it/download/...T4_Dev-C++.zip
    Last edited by Morea; 22nd February 2006 at 08:07.

  4. #4
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Anyone here with a working Qt 4 and Dev-C++ setup?

    In that case, please have a look at this thread
    http://www.qtcentre.org/forum/showthread.php?t=825

    Sorry for this crossposting but I have been fighting with this problem far too long now.

  5. #5
    Join Date
    Jan 2006
    Location
    Scandinavia
    Posts
    62
    Thanks
    5
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need help installing.

    The zip file you referred to was a mess (.QTApplication.zip) Some files had to be re-named etc.
    The Example_Qtui.zip was not possible to compile. One include file was blank.

    After messing with re-naming I could compile and run the files under QTApplication.zip. I did not encounter the problems you mention.

    I generated new .pro file with
    Qt Code:
    1. qmake -project
    To copy to clipboard, switch view to plain text mode 
    new makefile with
    Qt Code:
    1. qmake -o Makefile
    To copy to clipboard, switch view to plain text mode 
    and compiled with gmake

  6. #6
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Need help installing.

    So you've managed to get dev-c++ to work with this? I'm amazed. But you can't get it to compile without running qmake explicitly in a command window?

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Need help installing.

    From the output of the compiler it looks like moc is not being called.
    You need to create a pro file (in command line: qmake -project).
    This will create a pro file.
    Then you do a qmake <yourprofile.pro>, this will create a make file.
    In Dev-C++ you need then, in the option tell the IDE to use that makefile with the current project.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Need help installing.

    And make sure you have a header file for your class containing Q_OBJECT. moc only searches header files for Q_OBJECT macro.

Similar Threads

  1. Installing Qt 4.4 for Morons?
    By chris062689 in forum Installation and Deployment
    Replies: 14
    Last Post: 11th October 2008, 08:56
  2. problem with Qt/ Windows--pls help
    By swamyonline in forum Installation and Deployment
    Replies: 8
    Last Post: 7th July 2008, 20:39
  3. can't create qmake when installing at windows XP with win32-g++
    By owen_263 in forum Installation and Deployment
    Replies: 4
    Last Post: 31st March 2008, 07:39
  4. installing and Qt3 and Qt4 in a single machine
    By joseph in forum Installation and Deployment
    Replies: 1
    Last Post: 20th June 2007, 13:58
  5. Installing Qt 4.1 (open source) on Windows XP
    By katrina in forum Installation and Deployment
    Replies: 8
    Last Post: 19th February 2006, 12:26

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.