Qt5 development primer

Page  
4

January 31, 2012

Philius Philius
Lab Rat
29 posts

Sorry for editing my messages but the ground is moving under me.

I rebuilt with “regular” OpenGL and found one more problem:
qtwebkit-examples-and-demos/examples/browser/cookiejar.cpp is missing “#include <QNetworkCookie>”.

I sent a message to development@qt-project.org so hopefully the patch (along with my patch for qtwebkit) should find their way into GIT soon.

Other than that, with the approach detailed in my previous post, the build succeeded.

It took about 4 hours with “make -j 2” on my dual core laptop with both cores running at 1.867 GHz.

February 3, 2012

werispaul werispaul
Lab Rat
4 posts

I had to use “-prefix CD\qtbase” option as described in the qt5 git readme file, to get through the configure step without errors. By not specifying the prefix, my mkspec (win32-msvc2010), was searched in “qtbase\bin” instead in “qtbase”.

In addition i had to install python, because one of the compilation steps had an python call.

To init the QT Modules I used “git submodule init” and “git submodule update”. Are there any magics behind the perl init-submodule script i’m missing (beside submodule selection and git user settings)?

Actually i’m trying to compile the current git master using Win 7 and VS2010 without success.

  1.         cl -c -FIqt_widgets_pch.h -Yuqt_widgets_pch.h -Fptmp\obj\debug_shared\QtWidgetsd_pch.pch -nologo -Zm200 -Zc:wchar_t -Zi -MDd -W3 -w34100 -w341
  2. 89 -MP -GR -EHsc -DQT_SHARED -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_BUILD_WIDGETS_LIB -DQT_NO_USING_NAMESPACE -DQT_MAKEDLL -DQT_NO_CAST_TO_ASCI
  3. I -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -D_USE_MATH_DEFINES -DQT_NO_STYLE_MAC -DQT_NO_STYLE_GTK -DQT_NO_STYLE_WINDOWSCE -DQ
  4. T_NO_STYLE_WINDOWSMOBILE -DQ_INTERNAL_QAPP_SRC -DQT_NO_DIRECTWRITE -DQT_DLL -DQT_GUI_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_H
  5. AVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -I"..\..\include\QtCore" -I"..\..\include\QtCore\5.0.0" -I"..\..\include\QtCore\5.0.0\QtCore"
  6. -I"..\..\include\QtGui\5.0.0" -I"..\..\include\QtGui\5.0.0\QtGui" -I"..\..\include\QtGui" -I"..\..\include" -I"..\..\include\QtWidgets\5.0.0" -I"..\..
  7. \include\QtWidgets\5.0.0\QtWidgets" -I"..\..\include\QtWidgets" -I"..\..\include" -I"tmp\rcc\debug_shared" -I"tmp" -I"..\3rdparty\wintab" -I"dialogs"
  8. -I"..\3rdparty\harfbuzz\src" -I"tmp\moc\debug_shared" -I"." -I"..\..\mkspecs\win32-msvc2010" -Fotmp\obj\debug_shared\ @C:\Users\vth\AppData\Local\Temp
  9. \nmDEE9.tmp
  10. c:\qt\5.0\qtbase\include\qtwidgets\5.0.0\qtwidgets\private\../../../../../src/widgets/dialogs/qdialog_p.h(61) : fatal error C1083: Datei (Include) kan
  11. n nicht geöffnet werden: "QtGui/QPlatformDialogHelper": No such file or directory
  12. NMAKE : fatal error U1077: ""c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"": Rückgabe-Code "0x2"
  13. Stop.
  14. NMAKE : fatal error U1077: ""c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"": Rückgabe-Code "0x2"
  15. Stop.
  16. NMAKE : fatal error U1077: "cd": Rückgabe-Code "0x2"
  17. Stop.
  18. NMAKE : fatal error U1077: "cd": Rückgabe-Code "0x2"
  19. Stop.

Is there a nightly build process for Qt5 or kind of branch which is stable in the meaning of: at least compilable?

February 5, 2012

RazrFalcon RazrFalcon
Lab Rat
102 posts

Can’t configure on ArchLinux x64

No QPA platform plugin enabled! If you really want to build without a QPA platform plugin you must pass -no-xcb and -no-wayland to configure. Doing this will produce a Qt that cannot run GUI applications.

But libxcb, mesa and gperf are installed.

Any suggestions?
Thanks.

 Signature 

QT != Qt
Gentoo + KDE

February 5, 2012

peppe peppe
Ant Farmer
1005 posts

Add the option -verbose to configure to figure out which test is failing.

Be sure to install almost all xcb-related packages from your distribution, esp. the ones related to the various X extensions. Double check also their version.

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

February 5, 2012

RazrFalcon RazrFalcon
Lab Rat
102 posts

Thanks. Verbose helped.

Here is my installed xcb-package list:
extra/libxcb
extra/xcb-proto
extra/xcb-util
extra/xcb-util-image
extra/xcb-util-keysyms
extra/xcb-util-renderutil
extra/xcb-util-wm

 Signature 

QT != Qt
Gentoo + KDE

February 5, 2012

RazrFalcon RazrFalcon
Lab Rat
102 posts

Hello again. I have a new error:

  1. cd qtsvg/ && make -f Makefile
  2. make[1]: Entering directory `/media/data/Additional/Sources/qt5/qtsvg'
  3. /media/data/Additional/Sources/qt5/qtbase/bin/qmake QMAKE_ABSOLUTE_SOURCE_PATH=/media/data/Additional/Sources/qt5/qtbase -o Makefile qtsvg.pro
  4. QMAKESPEC has not been set, so configuration cannot be deduced.
  5. Error processing project file: qtsvg.pro
  6. make[1]: *** [Makefile] Error 3
  7. make[1]: Leaving directory `/media/data/Additional/Sources/qt5/qtsvg'
  8. make: *** [module-qtsvg-make_default] Error 2

But all other moduls are build well. Error appears after hour of compilation, not at start.

 Signature 

QT != Qt
Gentoo + KDE

February 5, 2012

oneWonders oneWonders
Lab Rat
7 posts

Okay it was probably all broken before as i hadn’t installed the right prerequisites (the ubuntu 11.10 prerequisite had not been added to the instructions).
i.e.

  1. on Ubuntu Oneiric:
  2.  
  3.     sudo apt-get install libxcb.* libglu1-mesa-dev

as oppossed to:
  1. on Ubuntu/Debian:
  2.  
  3.     sudo aptitude install ~nlibxcb.*

I now get this error on compilation:

  1. In file included from ../3rdparty/freetype/src/autofit/autofit.c:23:0:
  2. ../3rdparty/freetype/src/autofit/afhints.c: In function ‘af_glyph_hints_reload’:
  3. ../3rdparty/freetype/src/autofit/afhints.c:642:21: warning: variable ‘first’ set but not used [-Wunused-but-set-variable]
  4. g++ -c -include .pch/debug-shared/QtPlatformSupport -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_NO_WAYLAND -DQT_NO_CORESERVICES -DQT_BUILD_PLATFORMSUPPORT_LIB -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_FROM_ASCII -DQT_COMPILES_IN_HARFBUZZ -DQT_NO_FONTCONFIG -DFT2_BUILD_LIBRARY -DQT_COMPILES_IN_HARFBUZZ -DQT_GUI_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include/QtCore/5.0.0 -I../../include/QtCore/5.0.0/QtCore -I../../include/QtGui/5.0.0 -I../../include/QtGui/5.0.0/QtGui -I../../include/QtGui -I../../include -I../../include/QtPlatformSupport/5.0.0 -I../../include/QtPlatformSupport/5.0.0/QtPlatformSupport -I../../include/QtPlatformSupport -I../../include -I.rcc/debug-shared -I../3rdparty/harfbuzz/src -I../3rdparty/freetype/builds/unix -I../3rdparty/freetype/src -I../3rdparty/freetype/include -I/usr/X11R6/include -I.moc/debug-shared -o .obj/debug-shared/qglxconvenience.o glxconvenience/qglxconvenience.cpp
  5. glxconvenience/qglxconvenience.cpp:47:36: fatal error: X11/extensions/Xrender.h: No such file or directory
  6. compilation terminated.
  7. make[2]: *** [.obj/debug-shared/qglxconvenience.o] Error 1
  8. make[2]: *** Waiting for unfinished jobs....
  9. make[2]: Leaving directory `/home/daniel/qt5/qtbase/src/platformsupport'
  10. make[1]: *** [sub-platformsupport-make_default-ordered] Error 2
  11. make[1]: Leaving directory `/home/daniel/qt5/qtbase'
  12. make: *** [module-qtbase-make_default] Error 2

So i was trying to work out what i was missing in terms of dependencies. Considering i installed libglu1-mesa-dev i am not sure.

February 7, 2012

werispaul werispaul
Lab Rat
4 posts

werispaul wrote:
Actually i’m trying to compile the current git master using Win 7 and VS2010 without success.

Finally got it working. In between I’ve switched from Strawberry Perl to ActivePerl. I’m not sure if it was the crux, but an option to keep in mind (as well as the order of perl in the system PATH, saw the wiki note quite late).

February 19, 2012

Deleted Member # 269f Deleted Member # 269f
Lab Rat
224 posts

Let me join the ranks of people, for whom building Qt5 has failed.

Using gcc 4.6.2 in Windows 7 ×64 environment.

The last console output before building failed (after spending 3 hours on it :( )

mingw32-make3: Leaving directory `C:/Users/Dian/qt5/qtbase/src/widgets’
mingw32-make2: Leaving directory `C:/Users/Dian/qt5/qtbase/src/widgets’
cd src\testlib\ && mingw32-make -f Makefile
mingw32-make2: Entering directory `C:/Users/Dian/qt5/qtbase/src/testlib’
mingw32-make -f Makefile.Debug all
mingw32-make3: Entering directory `C:/Users/Dian/qt5/qtbase/src/testlib’
g++ -c -fno-keep-inline-dllexport -g -Wall -frtti -fexceptions -mthreads -DQT_SH
ARED -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_AS
CII -DQTESTLIB_MAKEDLL -DQT_NO_DATASTREAM -DQT_MAKEDLL -DQT_ASCII_CAST_WARNINGS
-DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -D_USE_MATH_DEFINES -DQT_DLL -DQT_CORE_L
IB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 – I”..\..\include\QtCore” -I”..\..\include” -I”.” -I”..\..\include\QtTest\5.0.0” – I”..\..\include\QtTest\5.0.0\QtTest” -I”..\..\include\QtTest” -I”..\..\include”
-I“tmp\rcc\debug_shared” -I“tmp” -I“tmp\moc\debug_shared” -I”..\..\mkspecs\win32
-g++” -o tmp\obj\debug_shared\qtestcase.o qtestcase.cpp
qtestcase.cpp:73:21: fatal error: crtdbg.h: No such file or directory
compilation terminated.
mingw32-make3: *** [tmp/obj/debug_shared/qtestcase.o] Error 1
mingw32-make3: Leaving directory `C:/Users/Dian/qt5/qtbase/src/testlib’
mingw32-make2: *** [debug-all] Error 2
mingw32-make2: Leaving directory `C:/Users/Dian/qt5/qtbase/src/testlib’
mingw32-make1: *** [sub-testlib-make_default-ordered] Error 2
mingw32-make1: Leaving directory `C:/Users/Dian/qt5/qtbase’
mingw32-make: *** [module-qtbase-make_default] Error 2

Any ideas?
The missing file I actually do have on my PC, in:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\crtdbg.h
But what does it have to do with anything, since I am using the GCC toolchain?

Also, when I configured Qt I used “-nomake tests” – shouldn’t that result in skipping qttest?

February 21, 2012

Harry443 Harry443
Lab Rat
15 posts

Can someone provide a link for Qt 5 Download??

February 21, 2012

sierdzio sierdzio
Area 51 Engineer
5064 posts

git clone git://gitorious.org/qt/qt5.git qt5

Building Qt5 from Git. [developer.qt.nokia.com]

 Signature 

(Z(:^

February 23, 2012

kkoehne kkoehne
Ant Farmer
61 posts

@oneWonders: I just updated the package dependencies on the wiki, hope all are listed now (it’s not that often that one has a clean system to start on ;)

@werispaul: Yes, you need ActiveState perl, and actually also a recent version. But the wiki page already points that out…

@ddriver: No idea. All I can tell you is that most people developing Qt on Windows are using MSVC compilers (MSVC2008, MSVC2010).

February 23, 2012

Deleted Member # 269f Deleted Member # 269f
Lab Rat
224 posts

Yes, it seems I will have to give it another go using MSVC2010, I am really itching to play a bit with QtQuick 2 :)

EDIT: ARGHHHHHHHHHHH %$@#$@
Naturally, after wasting a ton of time the webkit failed, and just to make things even more irritating, when I configure with -no-webkit it says “Unknown option -no-webkit” even thou -no-webkit is listed in the configure options… WTH?

Also “nmake confclean” doesn’t work, returns “NMAKE : fatal error U1073: don’t know how to make ‘confclean’”

Also, I tried installing ICU so I can build webkit since the configure utility option doesn’t work, and the install procedure for ICU involves files that are not even present in the package.

I am so very, very angry I hardly contain from beating my hardware, even thou this is all the lousy software’s fault…

I get it that it is free software, prior to final stage, but can it really be that bad? I have build Qt from sources donzes of times and different versions, and it was always effortless.

February 24, 2012

pierrevr pierrevr
Lab Rat
17 posts

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:

  1. cd qtsvg/ && make -f Makefile
  2. make[1]: Entering directory `/home/pvr/qt5-build-neon/qtsvg'
  3. 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
  4. QMAKESPEC has not been set, so configuration cannot be deduced.
  5. Error processing project file: /home/pvr/qt5/qtsvg/src/src.pro
  6. make[1]: *** [src/Makefile] Error 3
  7. make[1]: Leaving directory `/home/pvr/qt5-build-neon/qtsvg'
  8. 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:

  1. cd svg/ && /home/pvr/qt5-build-neon/qtbase/bin/qmake /home/pvr/qt5/qtsvg/src/svg/svg.pro
  2. QMAKE_ABSOLUTE_SOURCE_PATH=/home/pvr/qt5/qtbase -o Makefile
  3. Project ERROR: Cannot load qmodule.pri!
  4. make[2]: *** [svg/Makefile] Error 2
  5. make[2]: Leaving directory `/home/pvr/qt5-build-neon/qtsvg/src'
  6. make[1]: *** [module-qtsvg-src-make_default] Error 2
  7. make[1]: Leaving directory `/home/pvr/qt5-build-neon/qtsvg'
  8. 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…

March 1, 2012

Yuchen Deng Yuchen Deng
Lab Rat
12 posts

1. I can’t build with different prefix too, MSVC2010SP1.
2. I can’t build QWebkit, I don’t know where is the ICU library place?
Any docs about ICU library installed in Windows?


  ‹‹ [SOLVED] You are not allowed to edit this page.      How to create and use custom libraries on Windows ››

You must log in to post a reply. Not a member yet? Register here!