Hi everybody,<br><br>I&#39;m a beginner in using VTK with QTcreator. I pick up an example from the Internet, which is the following.<br><br>The VTK.pro<br>=================================================================================<br>

<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">TARGET = VTK_App</p>
<p style="margin: 0px; text-indent: 0px;">TEMPLATE = app</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">SOURCES += main.cpp\</p>
<p style="margin: 0px; text-indent: 0px;">        vtk_example.cpp</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">HEADERS  += vtk_example.h</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">FORMS    += vtk_example.ui</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">LIBS += -L/usr/local/lib/vtk-5.4 -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</p>

<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">INCLUDEPATH +=/usr/local/VTK\</p>=========================================================================================<br>the main.cpp<br><br><br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">#include &lt;QtGui/QApplication&gt;</p>
<p style="margin: 0px; text-indent: 0px;">#include &quot;vtk_example.h&quot;</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">int main(int argc, char *argv[])</p>
<p style="margin: 0px; text-indent: 0px;">{</p>
<p style="margin: 0px; text-indent: 0px;">    QApplication a(argc, argv);</p>
<p style="margin: 0px; text-indent: 0px;">    VTK_example w;</p>
<p style="margin: 0px; text-indent: 0px;">   w.show();</p>
<p style="margin: 0px; text-indent: 0px;">    return a.exec();</p>
<p style="margin: 0px; text-indent: 0px;">    }</p>
<p style="margin: 0px; text-indent: 0px;"></p>====================================================================================================<br>vtk_example.cpp<br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">#include &lt;QVTKWidget.h&gt;</p>
<p style="margin: 0px; text-indent: 0px;">#include &lt;vtkRenderer.h&gt;</p>
<p style="margin: 0px; text-indent: 0px;">#include &lt;vtkRenderWindow.h&gt;</p>
<p style="margin: 0px; text-indent: 0px;">#include &quot;ui_vtk_example.h&quot;</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">VTK_example::VTK_example(QWidget *parent)</p>
<p style="margin: 0px; text-indent: 0px;">    : QMainWindow(parent), ui(new Ui::VTK_example)</p>
<p style="margin: 0px; text-indent: 0px;">{</p>
<p style="margin: 0px; text-indent: 0px;">    ui-&gt;setupUi(this);</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">    QVTKWidget* vtkWidget;</p>
<p style="margin: 0px; text-indent: 0px;">    vtkRenderer* ren;</p>
<p style="margin: 0px; text-indent: 0px;">    vtkWidget = new QVTKWidget(this,QFlag(0));</p>
<p style="margin: 0px; text-indent: 0px;">    ui-&gt;verticalLayout-&gt;addWidget(vtkWidget);</p>
<p style="margin: 0px; text-indent: 0px;">    ui-&gt;verticalLayout-&gt;update();</p>
<p style="margin: 0px; text-indent: 0px;">    ren = vtkRenderer::New();</p>
<p style="margin: 0px; text-indent: 0px;">    vtkWidget-&gt;GetRenderWindow()-&gt;AddRenderer(ren);</p>
<p style="margin: 0px; text-indent: 0px;">    ren-&gt;SetBackground(1.0,0,0);</p>
<p style="margin: 0px; text-indent: 0px;">    ren-&gt;Render();</p>
<p style="margin: 0px; text-indent: 0px;">}</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">VTK_example::~VTK_example()</p>
<p style="margin: 0px; text-indent: 0px;">{</p>
<p style="margin: 0px; text-indent: 0px;">    //delete ui;</p>
<p style="margin: 0px; text-indent: 0px;">}</p><br>===========================================================================================================<br>vtk_example.h<br><br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">#ifndef VTK_EXAMPLE_H</p>
<p style="margin: 0px; text-indent: 0px;">#define VTK_EXAMPLE_H</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">#include &lt;QtGui/QMainWindow&gt;</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">namespace Ui</p>
<p style="margin: 0px; text-indent: 0px;">{</p>
<p style="margin: 0px; text-indent: 0px;">    class VTK_example;</p>
<p style="margin: 0px; text-indent: 0px;">}</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">class VTK_example : public QMainWindow</p>
<p style="margin: 0px; text-indent: 0px;">{</p>
<p style="margin: 0px; text-indent: 0px;">    Q_OBJECT</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">public:</p>
<p style="margin: 0px; text-indent: 0px;">    VTK_example(QWidget *parent = 0);</p>
<p style="margin: 0px; text-indent: 0px;">    ~VTK_example();</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">private:</p>
<p style="margin: 0px; text-indent: 0px;">    Ui::VTK_example *ui;</p>
<p style="margin: 0px; text-indent: 0px;">};</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">#endif // VTK_EXAMPLE_H</p><br>==========================================<br>The program compile fine, but when I execute it, the following error is shown:<br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">&quot;&quot;The program has unexpectedly finished.</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">VTK_App exited with code 0&quot;&#39;</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">
Anybody has any idea about the error?</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">Any kind of help is appreciated.<br></p>-- <br>Jihan Zoghbi<br><br>