Qt5 development primer

Page  
2

October 14, 2011

jmfairlie jmfairlie
Lab Rat
4 posts

Now I tried with Ubuntu 11.04 with an ATI gpu (might be relevant) and linker isn’t able to find GL libraries. Indeed, for some reason, there is no /usr/lib/libGL.so in my machine (not sure if this is normal) but only in /usr/lib/mesa and /usr/lib/fglrx.

If I add “-opengl desktop” to configure then it shows the message:

The OpenGL functionality test failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in …/qt5/qtbase/mkspecs/linux-g++.

If I follow the suggestion and add those lines to qtbase/mkspecs/linux-g++/qmake.conf :

QMAKE_LIBDIR_OPENGL = /usr/lib/fglrx
QMAKE_INCDIR_OPENGL = /usr/include/GL
QMAKE_LIBS_OPENGL = -lGL

It doesn’t make a difference and linker is still unable to find the GL libraries, (I guess those macros are not being used)

However if I just add a symlink to any of the GL libs to /usr/lib it finally finds them.

Unfortunately, QtQuick2.0 examples (what I’m interested in) don’t work either, this time qmlscene SEGFAULTS in a seemingly unrelated call … I guess I’ll need to wait until a more stable version comes out.

October 15, 2011

kkoehne kkoehne
Ant Farmer
61 posts

Ubuntu 11.04 is used heavily in the development teams, so this should really work out of the box, without any environment variable tinkering. The libgl1-mesa-dev should include the /usr/lib/libGL.so file, try installing this package. (Btw, you can find out which package provides which file by using the “apt-get file search” command).

For reference, this is the output “configure -nokia-developer -nomake examples -nomake demos -nomake tests” gives me on an Ubuntu 11.04:

  1. Build type:    linux-g++
  2. Architecture:  i386
  3. Host architecture: i386
  4. Platform notes:
  5.  
  6.             - Also available for Linux: linux-kcc linux-icc linux-cxx
  7.        
  8. Build .................. libs
  9. Configuration ..........  debug shared dll qpa largefile stl precompile_header mmx 3dnow sse sse2 sse3 ssse3 sse4_1 sse4_2 avx  minimal-config small-config medium-config large-config full-config fontconfig xlib xcb-xlib phonon-backend accessibility opengl qpa reduce_exports clock-gettime clock-monotonic mremap getaddrinfo ipv6ifname getifaddrs inotify system-jpeg system-mng system-png png system-tiff system-freetype system-zlib nis cups glib gstreamer dbus openssl xcb alsa pulseaudio concurrent audio-backend svg v8 debug private_tests
  10. Debug .................. yes
  11. Qt 3 compatibility ..... no
  12. QtDBus module .......... yes (run-time)
  13. QtConcurrent code ...... yes
  14. QtGui module ........... yes
  15. QtScript module ........ yes
  16. QtScriptTools module ... yes
  17. QtXmlPatterns module ... yes
  18. Phonon module .......... yes
  19. Multimedia module ...... auto
  20. SVG module ............. yes
  21. WebKit module .......... yes
  22. JavaScriptCore JIT ..... To be decided by JavaScriptCore
  23. V8 module .............. yes
  24. Declarative module ..... yes
  25. Declarative debugging ...yes
  26. Location module ........ no
  27. Support for S60 ........ no
  28. Symbian DEF files ...... no
  29. STL support ............ yes
  30. PCH support ............ yes
  31. MMX/3DNOW/SSE/SSE2/SSE3. yes/yes/yes/yes/yes
  32. SSSE3/SSE4.1/SSE4.2..... yes/yes/yes
  33. AVX..................... yes
  34. IPv6 ifname support .... yes
  35. getaddrinfo support .... yes
  36. getifaddrs support ..... yes
  37. Accessibility .......... yes
  38. NIS support ............ yes
  39. CUPS support ........... yes
  40. Iconv support .......... no
  41. Glib support ........... yes
  42. GStreamer support ...... yes
  43. PulseAudio support ..... yes
  44. Large File support ..... yes
  45. GIF support ............ plugin
  46. TIFF support ........... plugin (system)
  47. JPEG support ........... plugin (system)
  48. PNG support ............ yes (system)
  49. MNG support ............ plugin (system)
  50. zlib support ........... system
  51. Session management ..... auto
  52. OpenGL support ......... yes (Desktop OpenGL)
  53. OpenVG support ......... no
  54. MySQL support .......... plugin
  55. SQLite support ......... plugin (qt)
  56. OpenSSL support ........ yes (run-time)
  57. Alsa support ........... yes
  58. ICD support ............ no
  59. libICU support ......... no
  60. Xcb support ............ limited (old version)

October 15, 2011

jmfairlie jmfairlie
Lab Rat
4 posts

this is what I got, I’ll check on Monday if getting rid of the differences makes any difference:

  1. --- a/jean
  2. +++ b/kkoehne
  3. -QtDBus module .......... no
  4. +QtDBus module .......... yes (run-time)
  5. -Phonon module .......... no
  6. +Phonon module .......... yes
  7. -CUPS support ........... no
  8. +CUPS support ........... yes
  9. -GStreamer support ...... no
  10. -PulseAudio support ..... no
  11. +GStreamer support ...... yes
  12. +PulseAudio support ..... yes
  13. -MNG support ............ plugin (qt)
  14. +MNG support ............ plugin (system)
  15. +MySQL support .......... plugin
  16. -OpenSSL support ........ no
  17. -Alsa support ........... no
  18. +OpenSSL support ........ yes (run-time)
  19. +Alsa support ........... yes

October 20, 2011

jmfairlie jmfairlie
Lab Rat
4 posts

pulled current latest version:

commit 0a0d66efceb64bcacffbf733053834829c657df7
Date: Wed Oct 19 07:38:37 2011 +1000

and this time qmlscene spit some more info after segfault:

“Cannot create platform GL context, none of GLX, EGL, DRI2 is enabled”

This message directed me to:
http://comments.gmane.org/gmane.comp.lib.qt.qml/3060

which suggests to install libx11-xcb-dev. Indeed I didn’t have it, so I installed, cleaned and rebuilt, and now it works.

If this package is required for qtdeclarative to work properly shouldn’t configure notice it and mention it somehow?
Anyhow, Just added this info to the wiki page.

November 22, 2011

qtd1d1 qtd1d1
Lab Rat
71 posts

The installation was successful, but when I try to compile my own application I get the following error:
QDeclarativeView: No such file or directory

Just read the windows needs python for QDeclarative. What packages do I need for Linux (Ubuntu 10.04) ?

Does anyone had similar problems?

November 23, 2011

andreagrandi andreagrandi
Lab Rat
6 posts

After compiling Qt5 I’d like to do a safe “make install” in my system. With “safe” I mean that I don’t want to overwtite my Qt4 libs on my system so they should be installed in (for example) /opt/qt5 if it’s possible.

I also would like to start packaging Qt5 in a Ubuntu PPA, but even if I’ve a little experience with packaging, I really don’t know how to split an installation in multiple packages (I mean: qt-multimedia, qt-database, qt-tools ecc…. just to make you an example): should I take example from the actual Qt4 packages available in Ubuntu? Anyone want to help me? Thanks!

November 24, 2011

qtd1d1 qtd1d1
Lab Rat
71 posts

How do you force qtbase/src/plugins/platforms/xcb to recompile?

December 29, 2011

markc markc
Lab Rat
34 posts

I get this at every dir level I tried on Archlinux x86_64…

  1. ~qt5-git/qtbase git submodule update --init src/3rdparty/v8
  2. You need to run this command from the toplevel of the working tree.

I already have a libv8 3.6.5.1 as part of my system so would it possible for qtbase and whatever else needs libv8 to just link against my system version?

January 3, 2012

ludde ludde
Ant Farmer
325 posts

Hi! Trying to build Qt 5 for the first time, but I’m not getting very far…
Seems like the init-repository script is not working properly with the the —http option. All the repos are cloned using “http:”, except for the qt3d repo which still tries to use “git:”.
Very simple problem, but with my total lack of experience with perl, I’m not sure how to work around it… If anyone could give me a hint on how to get past this, by fixing init-repository, or doing some manual step, it would be most appreciated.

January 3, 2012

markc markc
Lab Rat
34 posts

What is the best way to incorporate qtwebkit into a qt5 build?

  1. ...
  2. [pid 30835] open(".../qt5-git/.git/modules/qtwebkit/refs/heads/master", O_RDONLY) = -1 ENOENT (No such file or directory)
  3. [pid 30835] write(2, "fatal: Oops\n", 12fatal: Oops

@ludde, I’m not sure why there is not some plain English instructions to clone the repo exactly, or a bash script, rather than buried inside an obfuscated perl script that doesn’t seem to work. An example .git/config file would be more useful.

January 4, 2012

ludde ludde
Ant Farmer
325 posts

Managed to make init-repository clone all the modules (by fiddling a bit with the perl script, without really understanding what I was doing…).

Also managed to run configure. But compiling (using Microsoft Visual Studio 2005, on Windows 7, 64 bit) eventually fails:

  1. c:\users\ludde\qt\qt5\qtbase\src\plugins\platforms\windows\qtwindowsglobal.h(178) : error C2065: 'WM_XBUTTONDOWN' : undeclared identifier
  2. c:\users\ludde\qt\qt5\qtbase\src\plugins\platforms\windows\qtwindowsglobal.h(178) : error C2065: 'WM_XBUTTONDBLCLK' : undeclared identifier
  3. c:\users\ludde\qt\qt5\qtbase\src\plugins\platforms\windows\qwindowscontext.h(74) : error C2059: syntax error : '<L_TYPE_raw>'

Any ideas on what might be causing this?

January 11, 2012

kkoehne kkoehne
Ant Farmer
61 posts

@ludde: I filed https://bugreports.qt.nokia.com/browse/QTBUG-23580 regarding your problems with the -http option. About the windows problems … don’t know, it compiles for me :( I guess you’re better off subscribing to qt-development@qt-project.org, and posting your problems there.

January 21, 2012

oneWonders oneWonders
Lab Rat
8 posts

While running

  1. ./configure -developer-build -opensource -nomake examples -nomake tests

i get this error partway through:

  1. Creating qmake. Please wait...
  2. g++ -c -o project.o -pipe -DQMAKE_OPENSOURCE_EDITION -g -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/integrity -I/home/daniel/qt5/qtbase/include -I/home/daniel/qt5/qtbase/include/QtCore -I/home/daniel/qt5/qtbase/include/QtCore/5.0.0 -I/home/daniel/qt5/qtbase/include/QtCore/5.0.0/QtCore -I/home/daniel/qt5/qtbase/src/corelib/global -I/home/daniel/qt5/qtbase/src/corelib/xml -I/home/daniel/qt5/qtbase/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/home/daniel/qt5/qtbase/mkspecs/linux-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DEPRECATED  project.cpp
  3. make: g++: Command not found
  4. make: *** [project.o] Error 127

I am using ubuntu, does anyone know where i went wrong?
Sorry i’m rather new to all this :$

January 21, 2012

peppe peppe
Ant Farmer
1025 posts

Do you have gcc installed…?

 Signature 

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

January 21, 2012

ludde ludde
Ant Farmer
325 posts

Had this problem too. For some reason you need not only have gcc installed, but have it available as g++. This can be accomplished by installing the g++ package (and possibly also by just creating an alias from g++ to gcc, but I didn’t try this).

Page  
2

  ‹‹ [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!