hi there friendly qt centre,

another newbie question...

I'm trying to get vtk working with qt. I should also admit that I'm a nooby, so go easy. I'm trying to learn c++ for myself and have chosen the following configuration to get started;
OS: XP
toolkit: QT 4.5.1
IDE: QT Creator 1.2

VTK: 5.4.0

I downloaded and decompressed VTK "C:\vtk-5.4.0" on my system. I followed the instructions over on QT Forums to build VTK with cmake. I didn't forget to set VTK_USE_GUISUPPORT and VTK_USE_QVTK. I gave cmake the location of the source "C:/vtk-5.4.0" and specified a place to build the libraries "C:/vtk".

Thinking everything had gone smoothly, I proceeded with the simplest program I could get away with. The main class in my project is called VTK_Example.

main.cpp

Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "vtk_example.h"
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7. VTK_Example w;
  8. w.show();
  9. return a.exec();
  10. }
To copy to clipboard, switch view to plain text mode 

VTK_example.cpp
Qt Code:
  1. #include "vtk_example.h"
  2. #include <QVTKWidget.h>
  3. #include <vtkRenderer.h>
  4. #include <vtkRenderWindow.h>
  5. #include "ui_vtk_example.h"
  6.  
  7. VTK_Example::VTK_Example(QWidget *parent)
  8. : QMainWindow(parent), ui(new Ui::VTK_Example)
  9. {
  10. ui->setupUi(this);
  11.  
  12. QVTKWidget* vtkWidget;
  13. vtkRenderer* ren;
  14. vtkWidget = new QVTKWidget(this,QFlag(0));
  15. ui->verticalLayout->addWidget(vtkWidget);
  16. ui->verticalLayout->update();
  17. ren = vtkRenderer::New();
  18. vtkWidget->GetRenderWindow()->AddRenderer(ren);
  19. ren->SetBackground(1.0,0,0);
  20. ren->Render();
  21. }
  22.  
  23. VTK_Example::~VTK_Example()
  24. {
  25. delete ui;
  26. }
To copy to clipboard, switch view to plain text mode 

I included the following lines in my VTK_App.pro
Qt Code:
  1. LIBS += -LC:/vtk -lvtkCommon -lvtksys -lQVTK -lvtkQtChart -lvtkViews -lvtkWidgets -lvtkInfovis -lvtkRendering -lvtkGraphics -lvtkImaging -lvtkIO -lvtkFiltering -lvtklibxml2 -lvtkDICOMParser -lvtkpng -lvtkpng -lvtktiff -lvtkzlib -lvtkjpeg -lvtkalglib -lvtkexpat -lvtkverdict -lvtkmetaio -lvtkNetCDF -lvtksqlite -lvtkexoIIc -lvtkftgl -lvtkfreetype -lvtkHybrid
  2.  
  3. INCLUDEPATH += C:/vtk
To copy to clipboard, switch view to plain text mode 

When I try to build this simple program, I get the following errors;


Qt Code:
  1. C:/<snip>/code/VTK_App/vtk_example.cpp:2: QVTKWidget.h: No such file or directory
  2. C:/<snip>/code/VTK_App/vtk_example.cpp:2: vtkRenderer.h: No such file or directory
  3. C:/<snip>/code/VTK_App/vtk_example.cpp:2: vtkRenderWindow.h: No such file or directory
  4. ...
To copy to clipboard, switch view to plain text mode 

One of my theories is that cmake hasn't built VTK correctly. My C:\vtk\bin folder is completely empty.

Can anyone shed some light on where I've gone astray?

Any help would be greatly appreciated.

All the best,
floyd