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
Quote:
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...
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:
Code:
#include <QApplication>
#include <QMainWindow>
int main(int argc, char *argv[])
{
m.show();
return app.exec();
}
and
Code:
$ qmake -project
$ qmake
$ make
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 ... ;)
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.
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? :D ;)
Re: qwidget.h: No such file or directory - issues dont stop...
You mean something like this:
Code:
#include <QtApplication>
#include <QMainWindow>
#include <QVTKWidget.h> // or whatever you need to include for this
int main(int argc, char *argv[])
{
QVTKWidget *widget = new QVTKWidget(&mainWindow);
mainWindow.setCentralWidget(widget);
mainWindow.show();
return app.exec();
}
Re: qwidget.h: No such file or directory - issues dont stop...
Yeah, but more like this:
Code:
#include <QtApplication>
#include "mainwindow.h" // own mainwindow subclass of QMainWindow with designed interface
#include <QVTKWidget.h> // or whatever you need to include for this
int main(int argc, char *argv[])
{
MainWindow mainWindow;
QVTKWidget *widget = new QVTKWidget(&mainWindow);
mainWindow.setCentralWidget(widget);
mainWindow.show();
return app.exec();
}
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.
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.
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:
Quote:
_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
Code:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QVTKWidget>
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
QVTKWidget *central = new QVTKWidget();
setCentralWidget(central);
}
MainWindow::~MainWindow()
{
delete ui;
}
main.cpp like in the last posting
Code:
MainWindow * main = new MainWindow();
main->show();
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 ;)
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