Difference between revisions of "Documentation/4.0/Developers/Build Instructions/Prerequisites/Qt"
m |
|||
Line 1: | Line 1: | ||
+ | = Qt library requirements = | ||
+ | |||
+ | <br> | ||
+ | {{ambox | ||
+ | | type = warning | ||
+ | | text = While it is not enforced, we strongly recommend you to '''BUILD''' against the version of Qt reported below. We mean it.<br> | ||
+ | }} | ||
+ | |||
+ | * <font size="-1">That said, if you feel like experimenting, nothing prevent you from building against a difference version.</font> | ||
+ | |||
+ | * The links reported in the following table allow to download either the source code or binary of Qt. | ||
+ | |||
+ | * Consider reading [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Build_Instructions_for_QT|Slicer4: Build Instructions for Qt]] to find out if your use case require to either build from source or use the binaries. | ||
+ | |||
+ | {| border="1" style="margin-left: 20px;" | ||
+ | |- bgcolor="#FFFFCC" | ||
+ | !rowspan="3"| | ||
+ | !colspan="2" rowspan="2"|Linux | ||
+ | !colspan="2"|Mac | ||
+ | !colspan="4"|Windows | ||
+ | |- bgcolor="#FFFFCC" | ||
+ | !colspan="1"|Tiger | ||
+ | !colspan="1"|Leopard, SnowLeopard | ||
+ | !colspan="2"|VS2008 | ||
+ | !colspan="2"|VS2010 | ||
+ | |- bgcolor="#FFFFCC" | ||
+ | !|32bits | ||
+ | !|64bits | ||
+ | !|32bits | ||
+ | !|64bits | ||
+ | !|32bits | ||
+ | !|64bits | ||
+ | !|32bits | ||
+ | !|64bits | ||
+ | |- | ||
+ | ! bgcolor="#FFFFCC" | [http://get.qt.nokia.com/qt/source/ Qt source link] | ||
+ | |align="center" colspan="2"| [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz 4.7.4] | ||
+ | |align="center" colspan="1"| [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz 4.7.4] | ||
+ | |align="center" colspan="1"| [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz 4.7.4] | ||
+ | |align="center" colspan="2"| [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip 4.7.4] | ||
+ | |align="center" colspan="2"| [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip 4.7.4] | ||
+ | |- | ||
+ | ! bgcolor="#FFFFCC" | [http://get.qt.nokia.com/qt/source/ Qt binary link] | ||
+ | |align="center" colspan="1"| [http://get.qt.nokia.com/qtsdk/Qt_SDK_Lin32_offline_v1_1_4_en.run SDK-1.1.4] | ||
+ | |align="center" colspan="1"| [http://get.qt.nokia.com/qtsdk/Qt_SDK_Lin64_offline_v1_1_4_en.run SDK-1.1.4] | ||
+ | |align="center" colspan="1"| [http://get.qt.nokia.com/qt/source/qt-mac-carbon-opensource-4.7.0.dmg carbon_4.7.0] | ||
+ | |align="center" colspan="1"| [ftp://ftp.qt.nokia.com/qt/source/qt-mac-opensource-4.7.4-debug-libs.dmg cocoa_4.7.4] | ||
+ | |align="center" colspan="1"| [http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.4-vs2008.exe 4.7.4] | ||
+ | |align="center" colspan="1"| - | ||
+ | |align="center" colspan="1"| [http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.4-vs2008.exe 4.7.4] | ||
+ | |align="center" colspan="1"| - | ||
+ | |} | ||
+ | |||
+ | ===Qt version specific issues === | ||
+ | Qt 4.6 on mac: hard to compile (tbd: be more specific) | ||
+ | |||
+ | Qt 4.6.x on windows (and possibly in linux/mac): No image base64 support in QLabel/QTooltips (work around exists though) | ||
+ | |||
+ | Qt 4.7 on mac: click outside of popup (http://na-mic.org/Mantis/view.php?id=1241) Fixed in Qt 4.8 ? | ||
+ | |||
+ | Qt 4.7.3 in mac: http://na-mic.org/Mantis/view.php?id=1388 (fixed in Qt 4.7.4) | ||
+ | |||
+ | Qt 4.8 does not work with PythonQt in slicer4 - suggested version is 4.7.4 | ||
+ | |||
+ | === How to change the minimum required version ? === | ||
+ | |||
+ | * It's indeed possible to use a different version, just be aware that moving forward in time, things may not work as expected. Even worse Slicer may simply fail to compile. | ||
+ | |||
+ | * By configuring Slicer using <code>-DSlicer_REQUIRED_QT_VERSION:STRING=4.7.0</code>, you will be able to change the minimum required version. | ||
+ | |||
+ | * See [https://github.com/Slicer/Slicer/commit/898bb14e 898bb14e], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=19698 r19698], [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008130.html Mailing list] | ||
+ | |||
+ | |||
+ | |||
+ | == Build instructions == | ||
+ | |||
Configure options are common to all platforms. | Configure options are common to all platforms. | ||
Check our different tutorials to learn them. | Check our different tutorials to learn them. | ||
− | |||
− | |||
== <font color="red">Build Qt on Windows </font> == | == <font color="red">Build Qt on Windows </font> == |
Revision as of 00:07, 29 March 2012
Home < Documentation < 4.0 < Developers < Build Instructions < Prerequisites < QtContents
Qt library requirements
While it is not enforced, we strongly recommend you to BUILD against the version of Qt reported below. We mean it. |
- That said, if you feel like experimenting, nothing prevent you from building against a difference version.
- The links reported in the following table allow to download either the source code or binary of Qt.
- Consider reading Slicer4: Build Instructions for Qt to find out if your use case require to either build from source or use the binaries.
Linux | Mac | Windows | ||||||
---|---|---|---|---|---|---|---|---|
Tiger | Leopard, SnowLeopard | VS2008 | VS2010 | |||||
32bits | 64bits | 32bits | 64bits | 32bits | 64bits | 32bits | 64bits | |
Qt source link | 4.7.4 | 4.7.4 | 4.7.4 | 4.7.4 | 4.7.4 | |||
Qt binary link | SDK-1.1.4 | SDK-1.1.4 | carbon_4.7.0 | cocoa_4.7.4 | 4.7.4 | - | 4.7.4 | - |
Qt version specific issues
Qt 4.6 on mac: hard to compile (tbd: be more specific)
Qt 4.6.x on windows (and possibly in linux/mac): No image base64 support in QLabel/QTooltips (work around exists though)
Qt 4.7 on mac: click outside of popup (http://na-mic.org/Mantis/view.php?id=1241) Fixed in Qt 4.8 ?
Qt 4.7.3 in mac: http://na-mic.org/Mantis/view.php?id=1388 (fixed in Qt 4.7.4)
Qt 4.8 does not work with PythonQt in slicer4 - suggested version is 4.7.4
How to change the minimum required version ?
- It's indeed possible to use a different version, just be aware that moving forward in time, things may not work as expected. Even worse Slicer may simply fail to compile.
- By configuring Slicer using
-DSlicer_REQUIRED_QT_VERSION:STRING=4.7.0
, you will be able to change the minimum required version.
- See 898bb14e, r19698, Mailing list
Build instructions
Configure options are common to all platforms.
Check our different tutorials to learn them.
Build Qt on Windows
- Using the Qt Designer on Windows requires that the Slicer plugins are in the same mode as Qt. If Qt was compiled in Release mode (default), Slicer would have to be compiled in Release mode as well. However if Qt is compiled in Debug mode only, Slicer has to be compiled in Debug too. When Qt is in "Release and Debug" mode only the Release version of Designer.exe is generated, Slicer would have to be compiled in Release. So for developers, the Debug mode is recommended, this is why we detail the compilation of Qt below.
- Use a windows extracter to unzip the [#Prerequisites|Qt zip archive], don't use cygwin unzip it.
- launch the msvc2008 command prompt (MSVC08->Tools->Visual Studio 2008 CommandPrompt) (or: launch cmd.exe and run
vcvars32.bat
) Note: Start x64 prompt from Start menu (don't start from inside visual studio or it will be an x86 32 bit shell). Menu item is "Visual Studio 2008 x64 Win64 Command Prompt" - build with
configure.exe -platform win32-msvc2008 -debug
- When asked, choose open source license type (o), then accept the license (y)
- Note: the option
-prefix
doesn't work on Windows. - Note: According to [1] Qt does not support msvc2008 on windows xp. However, running
configure.exe
with no-platform
argument seems to work. If you run configure with the-platform
argument first by mistake, and ifconfigure -clean
doesn't work, then you may need to start from a fresh extraction from the .zip archive before runningconfigure.exe
again with no-platform
, unless you can runnmake
with the config clean target. - Note: for Microsoft Visual Studio 2010 users, Qt 4.6.3 is hard to configure with MSVC2010, use Qt 4.7.x instead. Build with
set QMAKESPEC=win32-msvc2010
andconfigure -platform win32-msvc2010 -debug
- run
nmake
- Note: 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: If you encounter the following error
api\qscriptextensionplugin.h(43): Error: Undefined interface,
, delete the files \src\script\tmp\moc\debug_shared\mocinclude.tmp and \src\script\tmp\moc\release_shared\mocinclude.tmp and restart nmake. For more info, please see QTBug 6470].
- Note: 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
Build Qt on Linux
- Downloading the binaries of Qt works fine with Linux, you do not have to compile Qt manually.
- Note: You need to install the libQtWebkit-devel package too.
- The following descriptions are given for people who want to compile Qt anyway.
- Consider installing the following optional packages (
libxt-dev libxrender-dev libxrandr-dev libxinerama-dev libxcursor-dev libfontconfig-dev libglib2.0-dev
)
- Consider installing the following optional packages (
mkdir Qt mkdir Qt-build cd Qt wget http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.3.tar.gz tar xvfz qt-everywhere-opensource-src-4.6.3.tar.gz cd qt-everywhere-opensource-src-4.6.3 echo yes | ./configure -prefix ../../Qt-build -debug-and-release -opensource -no-qt3support -webkit make -j8 make install
Note: On a 64 bit system, you may have to add -arch x86_64
to the Qt configure command line (?)
Note: Adapt -j8
with the number of core on your machine, a dual core should probably not do more than -j3
, an 8 core machine can resonably go as much as -j12
.
Build Qt on Mac
Same as Linux. Use the flag -cocoa
on the configure command-line(the -shared
flag should be set automatically); for a 64 bit build on SnowLeopard use -arch x86_64
. For more information go to http://doc.qt.nokia.com/4.6/developing-on-mac.html (warning default values are different: -carbon
vs -cocoa
for Qt 4.7: http://doc.qt.nokia.com/4.7/developing-on-mac.html)