Results 1 to 11 of 11

Thread: qwidget.h: No such file or directory - issues dont stop...

  1. #1
    Join Date
    Jan 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X

    Default qwidget.h: No such file or directory - issues dont stop...

    Hi,

    i spent the whole day to just run a small application, and i got problem after problem.

    i just started to install qt with the help of http://doc.qt.nokia.com/4.7/install-mac.html
    - works for me.

    but now, i havent got any idea, why i get the following error message

    In file included from /main.cpp:21:
    /usr/local/include/vtk-5.6/QVTKWidget.h:39:21: error: qwidget.h: No such file or directory
    What the f.. is wrong with my libraries?
    I got only problems with qt and the qvtk extension... ://

    Just need help...
    Last edited by larsemann; 16th January 2011 at 19:47.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qwidget.h: No such file or directory - issues dont stop...

    It looks like your compiler does not know where to find Qt include files (not libraries). Can you build a simple Qt-only example?

    main.cpp is:
    Qt Code:
    1. #include <QApplication>
    2. #include <QMainWindow>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication app(argc, argv);
    7.  
    8. m.show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 
    and
    Qt Code:
    1. $ qmake -project
    2. $ qmake
    3. $ make
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: qwidget.h: No such file or directory - issues dont stop...

    Hi,

    yeah, that works well, i already tried it with the help of the qtcreator.
    i think i have to study more on cmake-functionalities and how to write an adequate CMakelist.txt, before trying to get really good results with this amazing framework.

    thanks for your help! ill keep on working ...

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qwidget.h: No such file or directory - issues dont stop...

    Mentioning that you were using CMake in your original question would probably have been useful

    There is Qt4 support in CMake.
    [WIKI]Compiling Qt4 apps with CMake[/WIKI] could be useful.

  5. #5
    Join Date
    Jan 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: qwidget.h: No such file or directory - issues dont stop...

    thank you for your help, i will definitely walk-through this help...

    I'm just trying to find an own way through all of these compile-possibilities.

    I'd just got a working version of an app, displaying a small vtk rendered stack of pictures. now my next task is to extend it with some functionalities from qt, f.e. a slider to slide through these pictures...
    but for me its very difficult to get started with importing my cmake-prepared application into qtcreator to design the interface... and then connecting the interface with the app. puuah...

    is there a good and easy way to extend a single main.cpp with an ordinary 'mainwindow.h' ( subclass of QMainWindow ), which has this QVTKWidget as CentralWidget?

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qwidget.h: No such file or directory - issues dont stop...

    You mean something like this:
    Qt Code:
    1. #include <QtApplication>
    2. #include <QMainWindow>
    3. #include <QVTKWidget.h> // or whatever you need to include for this
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc,argv);
    8.  
    9. QMainWindow mainWindow;
    10.  
    11. QVTKWidget *widget = new QVTKWidget(&mainWindow);
    12. mainWindow.setCentralWidget(widget);
    13.  
    14. mainWindow.show();
    15. return app.exec();
    16. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by ChrisW67; 19th January 2011 at 02:55.

  7. #7
    Join Date
    Jan 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: qwidget.h: No such file or directory - issues dont stop...

    Yeah, but more like this:

    Qt Code:
    1. #include <QtApplication>
    2. #include "mainwindow.h" // own mainwindow subclass of QMainWindow with designed interface
    3. #include <QVTKWidget.h> // or whatever you need to include for this
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc,argv);
    8.  
    9. MainWindow mainWindow;
    10.  
    11. QVTKWidget *widget = new QVTKWidget(&mainWindow);
    12. mainWindow.setCentralWidget(widget);
    13.  
    14. mainWindow.show();
    15. return app.exec();
    16. }
    To copy to clipboard, switch view to plain text mode 

    But i always get a "symbol(s) not found" and "collector2 Id" error message, if i tryout... I guess those are standard include error messages from c++ compiler, but i don't know yet why. i think i'll have to work on it.

  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qwidget.h: No such file or directory - issues dont stop...

    What are the actual error messages. Don't paraphrase: copy and paste. My guess is that your build system is not adding the necessary libraries/library paths to the linking command i.e. "symbol(s) not found". I have no idea where "collector2 Id" is coming from but I would guess that collector2 is the name of something in your code.

    You would normally insert the central widget of your QMainWindow in its constructor, not main.

  9. #9
    Join Date
    Jan 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: qwidget.h: No such file or directory - issues dont stop...

    I haven't copied and pasted. I just hat this solution several times in different variations

    compiler output is:
    _main in main.cpp.o
    "MainWindow::MainWindow(QWidget*)", referenced from:
    _main in main.cpp.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    mainwindow.cpp
    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3.  
    4. #include <QVTKWidget>
    5.  
    6. MainWindow::MainWindow(QWidget *parent) :
    7. QMainWindow(parent),
    8. ui(new Ui::MainWindow)
    9. {
    10. ui->setupUi(this);
    11. QVTKWidget *central = new QVTKWidget();
    12. setCentralWidget(central);
    13. }
    14.  
    15. MainWindow::~MainWindow()
    16. {
    17. delete ui;
    18. }
    To copy to clipboard, switch view to plain text mode 

    main.cpp like in the last posting
    Qt Code:
    1. MainWindow * main = new MainWindow();
    2. main->show();
    To copy to clipboard, switch view to plain text mode 
    Last edited by larsemann; 19th January 2011 at 09:15.

  10. #10
    Join Date
    Jan 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: qwidget.h: No such file or directory - issues dont stop...

    Nice, solved it after re-reading http://www.vtk.org/Wiki/VTK/Tutorial...istsFileForQt4 .
    Thank you, i'll be back

  11. #11
    Join Date
    Feb 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: qwidget.h: No such file or directory - issues dont stop...

    Hi larsemann,

    I've been following your posts since recently I've had the same issues (even when compiling VTK I had to adjust the flags for -fobjc)...

    Anyway, up to this point I've just been able to compile Qt+VTK projects (the examples) using CMake, but for now I've not been able of doing this using QtCreator... Have you managed to do this or do you already make this using CMake...

    For sure I would like to do everything (coding, compiling and executing the application) from the same place (that is from QtCreator)

    Quote Originally Posted by larsemann View Post
    Nice, solved it after re-reading http://www.vtk.org/Wiki/VTK/Tutorial...istsFileForQt4 .
    Thank you, i'll be back

Similar Threads

  1. QWidget -> updateGeometry dont work.
    By patrik08 in forum Qt Programming
    Replies: 7
    Last Post: 22nd May 2013, 15:55
  2. Replies: 8
    Last Post: 9th November 2010, 21:11
  3. Replies: 4
    Last Post: 9th May 2010, 16:18
  4. Stop the thread during recursivly loading directory
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 14th May 2007, 19:02
  5. size issues for custom QWidget in QScrollArea
    By anotheruser in forum Qt Programming
    Replies: 1
    Last Post: 27th April 2006, 14:52

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.