Qt5 development primer
-
I will add my failure to this thread.
I managed to compile Qt without too many problems by specifying the -prefix ${ROOT}/qtbase (or -developer-build, to be exact). If I remember correctly, with the -developer-build, I still had some installation issues once qtbase passed. I ended up having to manually run install for each submodule...
However, when trying to build for the target platform, with -prefix /usr/lib/qt, as I want it on the target, I run into an error once qtbase is built:
@
cd qtsvg/ && make -f Makefile
make[1]: Entering directory/home/pvr/qt5-build-neon/qtsvg' cd src/ && /home/pvr/qt5-build-neon/qtbase/bin/qmake /home/pvr/qt5/qtsvg/src/src.pro QMAKE_ABSOLUTE_SOURCE_PATH=/home/pvr/qt5/qtbase -o Makefile QMAKESPEC has not been set, so configuration cannot be deduced. Error processing project file: /home/pvr/qt5/qtsvg/src/src.pro make[1]: *** [src/Makefile] Error 3 make[1]: Leaving directory
/home/pvr/qt5-build-neon/qtsvg'
make: *** [module-qtsvg-make_default] Error 2
@So I tried exporting QMAKESPEC as the path to my mkspec, but then I get the following error:
@
cd svg/ && /home/pvr/qt5-build-neon/qtbase/bin/qmake /home/pvr/qt5/qtsvg/src/svg/svg.pro
QMAKE_ABSOLUTE_SOURCE_PATH=/home/pvr/qt5/qtbase -o Makefile
Project ERROR: Cannot load qmodule.pri!
make[2]: *** [svg/Makefile] Error 2
make[2]: Leaving directory/home/pvr/qt5-build-neon/qtsvg/src' make[1]: *** [module-qtsvg-src-make_default] Error 2 make[1]: Leaving directory
/home/pvr/qt5-build-neon/qtsvg'
make: *** [module-qtsvg-make_default] Error 2
@So my question is essentially, is it obligatory to specify the prefix as the path to qtbase? Has anyone else managed to build qt with a different prefix?
edit:
I should add that I am cross-compiling from x86 to an ARM board (iMX515). I built Qt4.8 with no problems previously... -
@Yuchen: I don't know about ICU on Windows, but I do know that you can just build Qt without webkit by deleting / renaming qtwebkit, qtwebkit-examples-and-demos directories, and then re-running configure. Maybe you don't need it after all?
-
@kkoehne : Thanks for reply!
I need to build QWebKit, Because I want build QtCreator use Qt5.
But after try and try, and the final, I don't have any idea how to add ICU library for QWebKit.
And I find a way to build Qt5 when use another prefix.Step1:
set PATH= -
@kkoehne : Thanks for reply!
I need to build QWebKit, Because I want build QtCreator use Qt5.
But after try and try, and the final, I don't have any idea how to add ICU library for QWebKit.
And I find a way to build Qt5 when use another prefix.Step1:
set PATH...
set QTDIR...
Same the wiki.Step2:
configure -confirm-license -opensource -prefix D:\qpSOFT\DEVx86\qt5 -release -platform win32-msvc2010 -fast -no-stl -nomake examples -nomake tests
(QtSrcDir = D:\qpSOFT\Sources\Qt5)Step3:
nmake module-qtbase && nmake module-qtbase-install_subtargetsStep4:
nmake && nmake installThe meaning is we should install qtbase to prefix first.
Then we can build other module.Any tips or hits about How To Build QWebkit on Windows?
Thanks!! -
@Yuchen: Thanks for the tip on installing qtbase first. It works, but I don't understand why this is necessary. I am cross-compiling for a target system that has a completely different hierarchy, I don't consider it normal to have to install on the build system in this case. I ended up using a symlink on my dev system to, pointing to somewhere acceptable, installed with INSTALL_ROOT=/<path>, but I think this is a bug.
As for the Windows question, I wouldn't know sorry, I develop on Linux.
-
Re: building QWebkit on Windows:
The reason for the build failure are the following lines in qtwebkit/Source/WTF/WTF.pri:
@ contains(QT_CONFIG,icu) {
LIBS += -licui18n -licuuc -licudata
} else {
error("To build QtWebKit with Qt 5 you need ICU")
}
@I could not find a way to include icu in QT_CONFIG, but a brute force approach (for testing purposes) would be to remove the contains query and include the 3 icu libraries unconditionally.
-
hmuelner: That is a different problem, I believe. As stated in "Building_Qt_5_from_Git":http://developer.qt.nokia.com/wiki/Building_Qt_5_from_Git :
WebKit doesn’t compile, missing ICU
Currently there is no configure time check for ICU, so install it through the package manager through
on Ubuntu/Debian:sudo apt-get install libicu-dev
on Fedora:
yum search ICU
Alternatively you can also compile Qt without webkit by deleting / renaming the qtwebkit, qtwebkit-examples-and-demos directories. The -no-webkit option of configure does not work yet : https://bugreports.qt-project.org/browse/QTBUG-20577
-
Hello, I have tried to compile Qt5 under archlinux and under mac os, but in both cases I have got the same errors:
bq.
cd qtsvg/ && make -f Makefile
cd qtphonon/ && make -f Makefile
cd qtxmlpatterns/ && make -f Makefile
make[1]: Entering directory/home/kondr/Documents/qt5/qtxmlpatterns' /home/kondr/Documents/qt5/qtbase/bin/qmake QMAKE_ABSOLUTE_SOURCE_PATH=/home/kondr/Documents/qt5/qtbase -o Makefile qtxmlpatterns.pro Could not find mkspecs for your QMAKESPEC(default) after trying: /home/kondr/Documents/qt5/qtxmlpatterns/mkspecs /home/kondr/Documents/qt5/qt5/mkspecs make[1]: *** [Makefile] Error 3 make[1]: Leaving directory
/home/kondr/Documents/qt5/qtxmlpatterns'
make: *** [module-qtxmlpatterns-make_default] Error 2
make: *** Waiting for unfinished jobs....
make[1]: Entering directory/home/kondr/Documents/qt5/qtsvg' /home/kondr/Documents/qt5/qtbase/bin/qmake QMAKE_ABSOLUTE_SOURCE_PATH=/home/kondr/Documents/qt5/qtbase -o Makefile qtsvg.pro Could not find mkspecs for your QMAKESPEC(default) after trying: /home/kondr/Documents/qt5/qtsvg/mkspecs /home/kondr/Documents/qt5/qt5/mkspecs make[1]: *** [Makefile] Error 3 make[1]: Leaving directory
/home/kondr/Documents/qt5/qtsvg'
make: *** [module-qtsvg-make_default] Error 2
make[1]: Entering directory/home/kondr/Documents/qt5/qtphonon' /home/kondr/Documents/qt5/qtbase/bin/qmake QMAKE_ABSOLUTE_SOURCE_PATH=/home/kondr/Documents/qt5/qtbase -o Makefile qtphonon.pro Could not find mkspecs for your QMAKESPEC(default) after trying: /home/kondr/Documents/qt5/qtphonon/mkspecs /home/kondr/Documents/qt5/qt5/mkspecs make[1]: *** [Makefile] Error 3 make[1]: Leaving directory
/home/kondr/Documents/qt5/qtphonon'
make: *** [module-qtphonon-make_default] Error 2I have used the next command:
bq. git clone git://gitorious.org/qt/qt5.git qt5 && cd qt5 && perl init-repository && export PATH="$PWD/qtbase/bin:$PATH" && ./configure -prefix $PWD/qt5 -opensource -confirm-license -nomake tests -nomake examples && make -j3
In addition I would like to know how to compile Qt 5 for a special arch? (for example, how to compile Qt 5 for i386 arch on x86_64 OS?)
-
I made some progress (but did not succeed) with compiling the current git version of qtwebkit with vs2010 in windows7(64):
My Qt directory is in d:\Qt\qt5.
-
I created an additional system cpp directory in d:\cpp with an include and a lib subdirectory
-
I add two variables to my system environment: INCLUDE=d:\cpp\include and LIB=d:\cpp\lib and started a new Visual Studio Command Prompt.
-
I copied qedit.h from the Windows SDK 6.0A to d:\cpp\include
-
I got the ICU libraries form http://download.icu-project.org/files/icu4c/4.8.1.1/icu4c-4_8_1_1-Win32-msvc10.zip
-
I copied the icu headers ti d:\cpp\include
-
I copied the icu lib files (*.lib and *.dll) to d:\Qt\qt5\qtbase\lib
-
I renamed icuin.lib to icui18n.lib, icuind.lib to icui18nd.lib and icudt.lib to icudata.lib
-
I got ftp://sources.redhat.com/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe for the pthread library
-
I copied the pthreads headers and libraries to d:\cpp\include and d:\cpp\lib
-
I changed one subroutine in d:/Qt/qt5/qtwebkit/Tools/Scripts/webkitdirs.pm to the following code (because the mkspec can be a ;-separated path list):
@sub retrieveQMakespecVar
{
my $mkspec = $[0];
my $varname = $[1];my $varvalue = undef;
#print "retrieveMakespecVar " . $mkspec . ", " . $varname . "\n";
my @mkspecs = split(/;/,$mkspec);
foreach $mkspec (@mkspecs) {
local SPEC;
open (SPEC, "<$mkspec") or next;
while (<SPEC>) {
if ($_ =~ /\sinclude((.+))/) {
# open the included mkspec
my $oldcwd = getcwd();
(my $volume, my $directories, my $file) = File::Spec->splitpath($mkspec);
my $newcwd = "$volume$directories";
chdir $newcwd if $newcwd;
$varvalue = retrieveQMakespecVar($1, $varname);
chdir $oldcwd;
} elsif ($_ =~ /$varname\s*=\s*([^\s]+)/) {
$varvalue = $1;
last;
}
}
close SPEC;
last if defined($varvalue);
}
return $varvalue;
}@ -
sub retrieveQMakespecVar
{
my $mkspec = $[0];
my $varname = $[1];my $varvalue = undef;
#print "retrieveMakespecVar " . $mkspec . ", " . $varname . "\n";
my @mkspecs = split(/;/,$mkspec);
foreach $mkspec (@mkspecs) {
local SPEC;
open (SPEC, "<$mkspec") or next;
while (<SPEC>) {
if ($_ =~ /\sinclude((.+))/) {
# open the included mkspec
my $oldcwd = getcwd();
(my $volume, my $directories, my $file) = File::Spec->splitpath($mkspec);
my $newcwd = "$volume$directories";
chdir $newcwd if $newcwd;
$varvalue = retrieveQMakespecVar($1, $varname);
chdir $oldcwd;
} elsif ($_ =~ /$varname\s*=\s*([^\s]+)/) {
$varvalue = $1;
last;
}
}
close SPEC;
last if defined($varvalue);
}
return $varvalue;
}
@ -
sub retrieveQMakespecVar
{
my $mkspec = $[0];
my $varname = $[1];my $varvalue = undef;
#print "retrieveMakespecVar " . $mkspec . ", " . $varname . "\n";
my @mkspecs = split(/;/,$mkspec);
foreach $mkspec (@mkspecs) {
local SPEC;
open (SPEC, "<$mkspec") or next;
while (<SPEC>) {
if ($_ =~ /\sinclude((.+))/) {
# open the included mkspec
my $oldcwd = getcwd();
(my $volume, my $directories, my $file) = File::Spec->splitpath($mkspec);
my $newcwd = "$volume$directories";
chdir $newcwd if $newcwd;
$varvalue = retrieveQMakespecVar($1, $varname);
chdir $oldcwd;
} elsif ($_ =~ /$varname\s*=\s*([^\s]+)/) {
$varvalue = $1;
last;
}
}
close SPEC;
last if defined($varvalue);
}
return $varvalue;
}
@
(Continued in next post)
-
-
(Continued)
- cd d:\Qt\qt5\qtwebkit
- set PATH=%PATH%;d:\Qt\qt5\gnuwin32\bin
- set QMAKEPATH=D:\Qt\qt5\qtwebkit\Tools\qmake
- perl Tools\Scripts\build-webkit --qt
It now fails in qtwebkit\Source\WebCore:
nmake.exe -f Makefile.WebCore.DerivedSources
breaks with: NMAKE : fatal error U1095: expanded command line 'echo D:/Qt/qt5/qtwebkit/Source/WebCore/Modules/geolocation/Geolocation.idl ...[lots of idl files] ... | tr ' ' '\n' > generated/idl_files.tmp && perl -ID:/Qt/qt5/qtwebkit/Source/WebCore/bindings/scripts D:/Qt/qt5/qtwebkit/Source/WebCore/bindings/scripts/resolve-supplemental.pl --defines "LANGUAGE_JAVASCRIPT=1 ENABLE_CHANNEL_MESSAGING=1 ENABLE_SQL_DATABASE=1 ENABLE_DATALIST=1 ENABLE_WORKERS=1 ENABLE_SHARED_WORKERS=1 ENABLE_XSLT=1 ENABLE_FILTERS=1 ENABLE_CSS_FILTERS=1 ENABLE_SVG=1 ENABLE_JAVASCRIPT_DEBUGGER=1 ENABLE_WEB_SOCKETS=1 ENABLE_WEB_TIMING=1 ENABLE_TOUCH_EVENTS=1 ENABLE_GESTURE_EVENTS=1 WTF_USE_TILED_BACKING_STORE=1 ENABLE_NOTIFICATIONS=1 ENABLE_DETAILS=1 ENABLE_METER_TAG=1 ENABLE_PROGRESS_TAG=1 ENABLE_BLOB=1 ENABLE_REQUEST_ANIMATION_FRAME=1" --idlFilesList generated/idl_files.tmp --supplementalDependencyFile generated/supplemental_dependency.tmp --idlAttributesFile D:/Qt/qt5/qtwebkit/Source/WebCore/bindings/scripts/IDLAttributes.txt --preprocessor "D:\Qt\qt5\qtbase\bin\moc.exe -E"' too long
(the command line is approx. 31400 characters long).
Does anybody have an idea how to fix this section in DerivedSources.pri?
@resolveSupplemental.input = IDL_ATTRIBUTES_FILE
resolveSupplemental.script = $$RESOLVE_SUPPLEMENTAL_SCRIPTFIXME : We need to use only perl at some point.
resolveSupplemental.commands = echo $$IDL_BINDINGS | tr ' ' '\n' > $$IDL_FILES_TMP &&
perl -I$$PWD/bindings/scripts $$resolveSupplemental.script
--defines "$${FEATURE_DEFINES_JAVASCRIPT}"
--idlFilesList $$IDL_FILES_TMP
--supplementalDependencyFile ${QMAKE_FUNC_FILE_OUT_PATH}/$$SUPPLEMENTAL_DEPENDENCY_FILE
--idlAttributesFile $${IDL_ATTRIBUTES_FILE}
--preprocessor "$${QMAKE_MOC} -E"
resolveSupplemental.output = $$SUPPLEMENTAL_DEPENDENCY_FILE
resolveSupplemental.add_output_to_sources = false
resolveSupplemental.depends = $$PWD/bindings/scripts/IDLParser.pm $$IDL_BINDINGS
GENERATORS += resolveSupplemental
@ -
Build qt5 on Windows 7 with VS2010 (next try, hope this is not a double post).
I tried again with the version from 2012-03-21 with this configuration:
configure -confirm-license -opensource -debug-and-release -platform win32-msvc2010 -fast -mp -opengl desktop -nomake tests -nomake examples
nmake generated the following files in qtbase/bin:
qmake.exe
moc.pdb
moc.ilk
moc.exe
rcc.pdb
rcc.ilk
rcc.exe
qdoc.pdb
qdoc.ilk
qdoc.exe
uic.pdb
uic.ilk
uic.exe
QtCored5.dll
QtCore5.dll
QtNetworkd5.dll
QtNetwork5.dll
QtSqld5.dll
QtSql5.dll
QtGuid5.dll
QtGui5.dll
QtXmld5.dll
QtXml5.dll
QtWidgetsd5.dll
QtWidgets5.dll
QtTestd5.dll
QtTest5.dll
QtPrintSupportd5.dll
QtPrintSupport5.dll
QtConcurrentd5.dll
QtConcurrent5.dll
QtOpenGLd5.dll
QtOpenGL5.dll
QtSvgd5.dll
QtSvg5.dll
phonond5.dll
phonon5.dll
QtXmlPatternsd5.dll
QtXmlPatterns5.dll
xmlpatterns.ilk
xmlpatterns.pdb
xmlpatterns.exe
xmlpatternsvalidator.pdb
xmlpatternsvalidator.ilk
xmlpatternsvalidator.exe
QtScriptd5.dll
QtScript5.dll
QtScriptToolsd5.dll
QtScriptTools5.dll
QtV8d5.dll
QtV85.dll
QtQmld5.dll
QtQml5.dll
QtQuickd5.dll
QtQuick5.dll
QtQuickTestd5.dll
QtQuickTest5.dll
qmlscene.ilk
qmlscene.pdb
qmlscene.exe
qmlplugindump.ilk
qmlplugindump.pdb
qmlplugindump.exe
qmlmin.pdb
qmlmin.ilk
qmlmin.exe
qmlprofiler.pdb
qmlprofiler.ilk
qmlprofiler.exe
qmltestrunner.pdb
qmltestrunner.ilk
qmltestrunner.exe
QtQuick1d5.dll
QtQuick15.dll
qmlviewer.ilk
qmlviewer.pdb
qmlviewer.exe
idc.ilk
idc.pdb
idc.exeBuilding of webkit failed when trying to link jsc.exe with a lot of warnings about importing locally defined symbols from JavaScriptCore.lib and 24 unresolved external symbols:
JSC::evaluate
JSC::checkSyntax
WTF::randomNumber
WTF::createThread
WTF::MetaAllocatorHandle::~MetaAllocatorHandle (12 times)
WTF::MetaAllocator::freeFreeSpaceNode
WTF::PassRefPtr<class WTF::MetaAllocatorHandle>
WTF::MetaAllocator::MetaAllocator
WTF::cryptographicallyRandomNumber (4 times)Any guesses how to correct this?
-
Build qt5 on Windows 7 with VS2010 (continued)
I could build all other modules (using nmake module-xxx) out of the box with the exception of qtmodule where moc could not parse dsserviceplugin.h because of a comma in Q_PLUGIN_METADATA. After correcting this it also built successfully.
-
Hi,
I am trying to build Qt5 on Chakra Linux. I have Xcb libraries installed, but when I start configuration script I get an error saying:
@No QPA platform plugin enabled!
If you really want to build without a QPA platform plugin you must pass
-no-xcb and -no-eglfs to configure. Doing this will
produce a Qt that cannot run GUI applications.
The dependencies needed for xcb to build are listed in
src/plugins/platforms/xcb/README@What I am missing here ?
-
i am facing compilation error in building qt5 (not webkit yet)
I am using Ubuntu, with all xcb and other dependency installed using apt-getconfigure was successful, whereas build failed in "wayland" (error log below).
Any clue on the wayland header files mismatch or version problems?@
_make[4]: Entering directory `/home/xyz/build/newqt5/qt5/qtwayland/src/plugins/platforms/wayland'
g++ -c -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -Wall -W -fPIC -DQT_NO_LIBUDEV -DQ_PLATFORM_WAYLAND -DQT_NO_WAYLAND_XKB -DQT_WAYLAND_GL_SUPPORT -DQT_WAYLAND_WINDOWMANAGER_SUPPORT -DQ_FONTCONFIGDATABASE -DQT_COMPILES_IN_HARFBUZZ -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -I/home/xyz/build/newqt5/qt5/qtbase/mkspecs/linux-g++ -I. -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore/5.0.0/QtCore -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui/5.0.0/QtGui -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport/5.0.0/QtPlatformSupport -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport -I/home/xyz/build/newqt5/qt5/qtbase/include -I../../../shared -Igl_integration/xcomposite_share -I.moc/debug-shared -o .obj/debug-shared/qwaylandintegration.o qwaylandintegration.cpp
In file included from qwaylandshmwindow.h:45:0,
from qwaylandintegration.cpp:46:
qwaylandwindow.h:112:18: error: ‘wl_callback_listener’ does not name a type
make[4]: *** [.obj/debug-shared/qwaylandintegration.o] Error 1
_
@ -
Issue is solved after downloading the release from
http://releases.qt-project.org/qt5.0/alpha/instead of GIT
[quote author="subbul" date="1333560508"] i am facing compilation error in building qt5 (not webkit yet)
I am using Ubuntu, with all xcb and other dependency installed using apt-getconfigure was successful, whereas build failed in "wayland" (error log below).
Any clue on the wayland header files mismatch or version problems?@
_make[4]: Entering directory `/home/xyz/build/newqt5/qt5/qtwayland/src/plugins/platforms/wayland'
g++ -c -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -Wall -W -fPIC -DQT_NO_LIBUDEV -DQ_PLATFORM_WAYLAND -DQT_NO_WAYLAND_XKB -DQT_WAYLAND_GL_SUPPORT -DQT_WAYLAND_WINDOWMANAGER_SUPPORT -DQ_FONTCONFIGDATABASE -DQT_COMPILES_IN_HARFBUZZ -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -I/home/xyz/build/newqt5/qt5/qtbase/mkspecs/linux-g++ -I. -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore/5.0.0/QtCore -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui/5.0.0/QtGui -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport/5.0.0/QtPlatformSupport -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport -I/home/xyz/build/newqt5/qt5/qtbase/include -I../../../shared -Igl_integration/xcomposite_share -I.moc/debug-shared -o .obj/debug-shared/qwaylandintegration.o qwaylandintegration.cpp
In file included from qwaylandshmwindow.h:45:0,
from qwaylandintegration.cpp:46:
qwaylandwindow.h:112:18: error: ‘wl_callback_listener’ does not name a type
make[4]: *** [.obj/debug-shared/qwaylandintegration.o] Error 1
_
@[/quote]