Slicer3:Developers:Projects:QtSlicer/Tutorials/CompileWithQt
From Slicer Wiki
Home < Slicer3:Developers:Projects:QtSlicer < Tutorials < CompileWithQt
Building Slicer with Qt
- Download and install Qt. As of winter 2009, get the 4.6 version.
- Windows - need to get source code. On the LGPL tab, select the source code download page for windows and visual studio 2008, and note that there is a link below where you can download the source code in a zip archive.
- build with
configure.exe -platform msvc2008
- run
vcvars32.bat
first - and then
nmake
. - building with webkit support requires that src/3rdparty/webkit/WebCore/tmp/moc/{debug,release}_shared/mocinclude.tmp be removed. else you will get linker errors like
QNetworkReplyHandler.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall WebCore::FormDataIODevice::metaObject(void)const (?metaObject@FormDataIODevice@WebCore@@UBEPBUQMetaObject@@XZ)
- Note: Using the Qt Designer on Windows requires that the Slicer widget plugins are compiled in the same mode than Qt. If Qt is compiled in Release mode (default), Slicer must be compiled in Release. If Qt is compiled in Debug mode only, Slicer must be compiled in Debug. (however if Qt is in Release and Debug, Slicer must be in Release).
- build with
- Linux/Mac - install full QtCreator package (use "-arch x86_64" for a 64 bit build on snowleopard)
- Windows - need to get source code. On the LGPL tab, select the source code download page for windows and visual studio 2008, and note that there is a link below where you can download the source code in a zip archive.
cd Slicer3-lib mkdir Qt mkdir Qt-build cd Qt wget http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.0.tar.gz tar xvfz qt-everywhere-opensource-src-4.6.0.tar.gz cd qt-everywhere-opensource-src-4.6.0 echo yes | ./configure -prefix ../../Qt-build -debug-and-release -opensource -no-qt3support make -j 16 make install
- Build VTK with Qt enabled
cd ../../VTK-build ../CMake-build/bin/ccmake . Press 't' to enter advanced mode. VTK_USE_GUISUPPORT to ON Press 'c' to configure. VTK_USE_QVTK to ON Press 'c' to configure. DESIRED_QT_VERSION to 4 Press 'c' to configure. QT_QMAKE_EXECUTABLE to {path to}/Slicer3-lib/Qt-build/bin/qmake Press 'c' to configure. Press 'g' to generate make -j16
- Build Slicer with Qt enabled.
cd ../../Slicer3-build ../Slicer3-lib/CMake-build/bin/ccmake . Slicer3_USE_QT ON Press 'c' to configure QT_QMAKE_EXECUTABLE to {path to}/Slicer3-lib/Qt-build/bin/qmake Press 'c' to configure and then press 'g' to generate. make -j16