Error building Qt Creator 2.8.1 with Qt 5.1.1 on Debian (with no prior installations)
-
I am setting up a development environment to build and debug using Qt and Qt Creator on Debian Linux. I got an error while building Qt Creator. (The error is at the bottom of this post.) I am not too familiar with building from the source (or really working on Linux), so I am asking for help on how to continue. Here are the steps that I took:
Right after getting Debian 7 installed, I downloaded the Qt 5.1.1 and Qt Creator 2.8.1 source files from qt-project.org/downloads (and extracted the files).
I installed Build Essentials with the command:
$ apt-get install build-essential perl python
Also installed:
$ apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-devI configured Qt with:
$ ./configure -opensource -confirm-license
And then ran make:
$ makeOnce make completed, I ran (from a root terminal):
$ make installI found I needed to make sure PATH included the Qt bin folder, so I edited /etc/profile to include /usr/local/Qt-5.1.1/bin and the end of PATH.
After this, I restarted to get the changes in /etc/profile, and qmake appeared to be running properly:
$ qmake -v
@QMake version 3.0
Using Qt version 5.1.1 in /usr/local/Qt-5.1.1/lib@So next I try to build Qt Creator with the following commands (according to the README):
$ qmake -r
$ makemake stops with the following error:
@In file included from /usr/local/Qt-5.1.1/include/QtCore/QList:1:0,
from ./tools/error.h:36
from tools/setupprojectparameters.h:34,
from tools/setupprojectparameters.cpp:29:
/usr/local/Qt-5.1.1/include/QtCore/qlist.h: In function ’void qbs::provideValuesTree(const QVariantMap&, QVariantMap*)’:
/usr/local/Qt-5.1.1/include/QtCore/qlist.h:622:5: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow]
cc1plus: all warnings being treated as errors
make[3]: *** [setupprojectparameters.o] Error 1
make[2]: *** [sub----shared-qbs-src-lib-make_first] Error 2
make[1]: *** [sub-libs-make_first-ordered] Error 2
make: *** [sub-src-make_first-ordered] Error 2@So, did I miss something? More importantly, what do I need to do from here to get Qt Creator up and running?
-
Hi, I've just stumbled upon the same problem, it seems that gcc gets confused re. that line no. 622 (in /usr/local/Qt-5.1.1/include/QtCore/qlist.h), if you help it out by just tweaking it:
Original code (line 622 and 623 in qlist.h):
@
if (alength < 0 || pos + alength > size())
alength = size() - pos;
@to this:
@
if (alength < 0 || pos > size() - alength)
alength = size() - pos;
@
gcc is happy again and you'll have your Qt Creator up and running. (At least I had :-)