QT / QT Creator / QWT / VTK on Ubuntu

INSTALL QT

sudo apt-get install libqt4-dev qtcreator

INSTALL QWT

svn checkout svn://svn.code.sf.net/p/qwt/code/branches/qwt-6.0 qwt-6.0

 cd qwt-6.0
 qmake qwt.pro
 make
 sudo make install
 
 cd examples
 qmake examples.pro
 make
 sudo make install
 
 cd ..
 
 cd designer
 qmake designer.pro
 make
 sudo make install

ln -s /usr/local/qwt-6.0.3-svn/plugins/designer/libqwt_designer_plugin.so /usr/lib/x86_64-linux-gnu/qt4/plugins/designer/

sudo ln -s /usr/local/qwt-6.0.3-svn/lib/* /usr/local/lib/
sudo ln -s /usr/local/qwt-6.0.3-svn/include/* /usr/local/include/
sudo ldconfig

Include in your project.pro file

#Begin QWT
INCLUDEPATH += "/usr/local/include/"
LIBS += -L"/usr/local/include/" -lqwt
#End QWT

Install VTK from Ubuntu packages

sudo apt-get install libvtk5.8 libvtk5.8-qt4 libvtk5-dev libvtk5-qt4-dev

Include in your project.pro file

#Begin VTK
INCLUDEPATH += "/usr/include/vtk-5.8"
LIBS += -L"/usr/lib/vtk-5.8" -lvtkCommon -lvtksys -lQVTK -lvtkRendering -lvtkGraphics -lvtkIO -lvtkInfovis -lvtkViews -lvtkFiltering -lvtkHybrid -lvtkWidgets
#End VTK

OR

INSTALL VTK (Manual method)

Install package: libxt-dev if file /usr/include/X11/StringDefs.h is missing

wget http://www.vtk.org/files/release/5.10/vtk-5.10.1.tar.gz

tar -xzvf vtk-5.10.1.tar.gz
cd VTK5.10.1
mkdir build
cd build
ccmake ../

TURN ON:

  • BUILD_SHARED_LIBS
  • VTK_USE_QT

Include in your project.pro file

#Begin VTK
INCLUDEPATH += "/usr/include/vtk-5.10"
LIBS += -L"/usr/lib/vtk-5.10" -lvtkCommon -lvtksys -lQVTK -lvtkRendering -lvtkGraphics -lvtkIO -lvtkInfovis -lvtkViews -lvtkFiltering -lvtkHybrid -lvtkWidgets
#End VTK

QR Code: URL of current page
QR Code: URL of current page howto:qt_qwt_vtk_ubuntu (generated for current page)