Qt5 development primer

Page  
7

July 10, 2012

Sfiet_Konstantin Sfiet_Konsta..
Ant Farmer
33 posts

Seems to be ok with latest updates

July 22, 2012

alpha_one_x86 alpha_one_x86
Lab Rat
8 posts

At the compilation under Windows I have:
Creating qmake…
g++ -c -oproject.o -O -IC:\Users\user\Desktop\qt5-src\qtbase/qmake -IC:\Users\us
er\Desktop\qt5-src\qtbase/qmake/generators -IC:\Users\user\Desktop\qt5-src\qtbas
e/qmake/generators/unix -IC:\Users\user\Desktop\qt5-src\qtbase/qmake/generators/
win32 -IC:\Users\user\Desktop\qt5-src\qtbase/qmake/generators/mac -IC:\Users\use
r\Desktop\qt5-src\qtbase/qmake/generators/integrity IC:\Users\user\Desktop\qt5
src\qtbase/include -IC:\Users\user\Desktop\qt5-src\qtbase/include/QtCore -IC:\Us
ers\user\Desktop\qt5-src\qtbase/include/QtCore/5.0.0 -IC:\Users\user\Desktop\qt5
-src\qtbase/include/QtCore/5.0.0/QtCore -IC:\Users\user\Desktop\qt5-src\qtbase/s
rc/corelib/global -IC:\Users\user\Desktop\qt5-src\qtbase/mkspecs/win32-g++ -IC:\
Users\user\Desktop\qt5-src\qtbase/tools/shared -DQT_NO_TEXTCODEC -DQT_NO_UNICODE
TABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BU
ILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_BOOTSTRAPPED -DQMAKE_OPENSOURCE_EDITION project.cpp
g++: CreateProcess: No such file or directory
mingw32-make: *** [project.o] Error 1
del /f project.o main.o makefile.o unixmake.o unixmake2.o mingw_make.o option.o
winmakefile.o projectgenerator.o property.o meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o borland_bmake.o msvc_nmake.o msvc_vcproj.o msvc_vcxp
roj.o msvc_objectmodel.o msbuild_objectmodel.o registry.o gbuild.o cesdkhandler.
o qbitarray.o qbuffer.o qarraydata.o qbytearray.o qcryptographichash.o qvsnprint
f.o qbytearraymatcher.o qconfig.o qdatetime.o qdir.o qdiriterator.o qfiledevice.
o qfile.o qtemporaryfile.o qfileinfo.o qabstractfileengine.o qfilesystementry.o
qfilesystemengine.o qfilesystemengine_win.o qfilesystemiterator_win.o qfsfileeng
ine.o qfsfileengine_iterator.o qfsfileengine_win.o qglobal.o qhash.o qiodevice.o qlibraryinfo.o qlist.o qlinkedlist.o qlocale.o qlocale_tools.o qlocale_win.o qm
alloc.o qmap.o qregexp.o qtextcodec.o qutfcodec.o qstring.o qstringlist.o qstrin
gbuilder.o qsystemerror.o qsystemlibrary.o qtextstream.o quuid.o qvector.o qsett
ings.o qsettings_win.o qvariant.o qmetatype.o qxmlstream.o qxmlutils.o qnumeric.
o qlogging.o
Could Not Find C:\Users\user\Desktop\qt5-src\qtbase\qmake\project.o
g++ -c -oproject.o -O -IC:\Users\user\Desktop\qt5-src\qtbase/qmake -IC:\Users\us
er\Desktop\qt5-src\qtbase/qmake/generators -IC:\Users\user\Desktop\qt5-src\qtbas
e/qmake/generators/unix -IC:\Users\user\Desktop\qt5-src\qtbase/qmake/generators/
win32 -IC:\Users\user\Desktop\qt5-src\qtbase/qmake/generators/mac -IC:\Users\use
r\Desktop\qt5-src\qtbase/qmake/generators/integrity IC:\Users\user\Desktop\qt5
src\qtbase/include -IC:\Users\user\Desktop\qt5-src\qtbase/include/QtCore -IC:\Us
ers\user\Desktop\qt5-src\qtbase/include/QtCore/5.0.0 -IC:\Users\user\Desktop\qt5
-src\qtbase/include/QtCore/5.0.0/QtCore -IC:\Users\user\Desktop\qt5-src\qtbase/s
rc/corelib/global -IC:\Users\user\Desktop\qt5-src\qtbase/mkspecs/win32-g++ -IC:\
Users\user\Desktop\qt5-src\qtbase/tools/shared -DQT_NO_TEXTCODEC -DQT_NO_UNICODE
TABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BU
ILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_BOOTSTRAPPED -DQMAKE_OPENSOURCE_EDITION project.cpp
g++: CreateProcess: No such file or directory
mingw32-make: *** [project.o] Error 1
Building qmake failed, return code 2

  • qtbase/configure exited with non-zero status.

but if I cd qtbase/qmake/;mingw32-make all it work.

 Signature 

The best way to do file copy is in Qt:
http://ultracopier.first-world.info/

August 2, 2012

gwfr gwfr
Lab Rat
6 posts

On MAC I encountered a problem: Under the last version of XCode you have to download the “command lines tools” seperatly from the xcode settings in the downloads pane.

August 24, 2012

GeneralPanic GeneralPanic
Lab Rat
2 posts

I was getting “The Remote End Hung up Unexpectedly” when running “perl init-repository”. I found that if I used the “-http” option at the end of that line, the failures stopped. It seems that the “git” protocol is a bit flaky. Making http the default in the “init-repository” script would make the process a bit more robust.

August 24, 2012

sierdzio sierdzio
Area 51 Engineer
2328 posts

You can also rerun the script with “-f”. Doesn’t fix git protocol, but often it works on second try.

 Signature 

(Z(:^

August 24, 2012

GeneralPanic GeneralPanic
Lab Rat
2 posts

Yeah, unfortunately for me, re-runnng w/git kept failing at different points.

November 15, 2012

bibbinator bibbinator
Lab Rat
2 posts

Hi,
I’m new to command line compiling and Git.

Thanks to the excellent guide [qt-project.org] I was able to build Qt from source. Now, with the latest beta 2 release, I’d like to update Qt.

My question is simple:

Do I need to run configure after:

git pull
git submodule update —recursive

Or can I just run make again without doing that?

A suggestion would be to update the “Getting Updates” section to include this answer as maybe others would wonder if they need to do that too.

Thanks,
Brett

November 15, 2012

sierdzio sierdzio
Area 51 Engineer
2328 posts

Tricky. Depends on what has changed in the source code, really. If you have a solid CPU and a bit of time on your hands, you can definitely try just running make, and then if it fails, you should do a proper clean (git clean -dxf, check the link you provided for a submodule declaration), configure and make.

 Signature 

(Z(:^

November 15, 2012

bibbinator bibbinator
Lab Rat
2 posts

Thanks for your post. I modified the wiki page updates section with a note that clean and configure may need to be re-run.

November 27, 2012

invisible invisible
Lab Rat
1 posts

I’m building on windows 7 ×64 with msvc2010 sp1 nmake.

For some reason the naming convention is different then the beta release and incompatible with the vs-addin..

All my lib files, dll files etc are named Qt5[lib].dll/lib instead of Qt[lib]5.dll/lib

My config: configure -developer-build -opensource -nomake examples -nomake tests

November 27, 2012

Lukas Geyer Lukas Geyer
Gene Splicer
2074 posts

See http://lists.qt-project.org/pipermail/development/2012-October/007215.html

December 15, 2012

cedrix cedrix
Lab Rat
5 posts

Hi,

First I have setup qt5 (both with the linux birnary file and by compiling it) on an Ubuntu 12.04 (and 11.10) KVM virtual machine. But I can’t launch any graphical qt program. I have issue with QPainter: that kind of mistakes:

  1. cedric@cedric-virtual-machine:~/Qt5.0.0beta2/5.0.0-beta2/gcc/bin$ ./assistant
  2. QWidget::paintEngine: Should no longer be called
  3. QPainter::begin: Paint device returned engine == 0, type: 1
  4. QWidget::paintEngine: Should no longer be called
  5. QPainter::begin: Paint device returned engine == 0, type: 1
  6. QPainter::font: Painter not active
  7. QPainter::pen: Painter not active
  8. ...

So I tried on a windows 32 bits virtual machine. First I installed it with the binary but I couldn’t find our the right microsoft compiler so it could work. So I tryed to compile it with mingw32-make. It worked with the following config:

  1. configure -platform win32-g++ -opengl desktop

Yeah I couldn’t find the right version of direct X sdk so I had some issue and choose to use the opengl option.

This version doesn’t work with qt creator. I don’t know if it is suppoed to? I have an issue with “ABI detection failed. Make sur to use a matching compiler when building. No qml viewer.” But I can launch the program named qmlviewer.exe. Also I can compile the following application with qmake.

pro file:

  1. ######################################################################
  2. # Automatically generated by qmake (3.0) sam. 15. déc. 15:49:19 2012
  3. ######################################################################
  4.  
  5. QT += widgets
  6. TEMPLATE = app
  7. TARGET = test03withoutCreator
  8. DEPENDPATH += .
  9. INCLUDEPATH += .
  10.  
  11. # Input
  12. SOURCES += main.cpp

main.cpp

  1. #include <QGuiApplication>
  2. #include <QPushButton>
  3.  
  4. Q_DECL_EXPORT int main(int argc, char *argv[]){
  5.     QGuiApplication app(argc, argv);
  6.  
  7.     QPushButton button("work");
  8.     button.show();
  9.  
  10.     return app.exec();
  11. }

but then, I have no idea how to launch it. I did:

  1. qmake
  2. mingw32-make release

Then I put the binary file in qtbase/bin, but I when I launch the application, I get the following message:
“This application has requested the runtime to terminate it in an unusual way.”
But the exemples and demos can be launch without any dll in their direcotry. I don’t get how that is possible.

Someone know what I should do so I can compile and launch application?

Sincerly,

Cédric

December 19, 2012

fxtech fxtech
Lab Rat
11 posts

I’m having trouble building the final release on Windows 7 ×64 with both VS2008 and VS2012. I have ActivePerl and Python 2.7 installed and in the path, and in both cases when I run “configure” I get this error:

  1. 'T:\home\Qt\5.0.0\qtbase\\configure.exe' is not recognized as an internal or external command, operable program or batch file.
  2. *** qtbase/configure exited with non-zero status.

Any ideas?

December 20, 2012

sierdzio sierdzio
Area 51 Engineer
2328 posts

You should be running configure.exe on windows, not the bash script.

Add a file named “.gitignore” to the root folder or comment out line 45 in configure.bat.

 Signature 

(Z(:^

December 28, 2012

jamcguire jamcguire
Lab Rat
3 posts

After several failed attempts at building, here’s how I finally managed to get QT5 to build with Nuwen.net’s MinGW 9.4, on Windows 7 64 bit SP1 without webkit.

I already had Nuwen’s mingw 9.4 installed (9.5 is now available), this can be obtained from http://www.nuwen.net/mingw.html

This needs to be extracted to c:\mingw or similar, and c:\mingw\bin will need to be in the PATH env variable.

Then I copied c:\mingw\bin\make.exe to c:\mingw\bin\mingw32-make.exe

I then downloaded and installed the following:

http://www.python.org/ftp/python/3.3.0/python-3.3.0.amd64.msi
http://files.rubyforge.vm.bytemark.co.uk/rubyinstaller/rubyinstaller-1.9.3-p362.exe
http://downloads.activestate.com/ActivePerl/releases/5.16.1.1601/ActivePerl-5.16.1.1601-MSWin32-x64-296175.msi
https://msysgit.googlecode.com/files/Git-1.8.0-preview20121022.exe

I used the installers to set the path for python, ruby and perl.

I downloaded QT5 (27th Dec 2012):

git clone git://gitorious.org/qt/qt5.git qt5
cd qt5
perl init-repository

Configured QT5:

configure -developer-build -opensource -nomake examples -nomake tests -qt-pcre -qt-libjpeg -opengl desktop

  • Configure informed me that webkit would not be built due to a missing dependency, so no additional parameters were required to disable this.
  • I have an ATi Radeon graphics driver with builtin OpenGL support
  • By default configure sets pcre to ‘system’ at one point I downloaded and built the latest version of pcre, including the pcre16 library, I placed this into my system path, but ld was still unable to locate the library and there was no means of passing the -L parameter to ld from what I can tell, build would fail with ‘unable to locate pcre16’, once you specify -qt-pcre as per the above, the build will use the embedded pcre library and magically succeed.
  • Again, for me, build would fail without specifying -qt-libjpeg

I then simply ran ‘make’

Good luck!

Page  
7

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