Building Qt-4.3.2 from source on Linux machine

2019-08-23 18:41发布

问题:

I am trying to build and compile Qt 4.3.2 on my linux machine.I have downloaded package from http://download.qt.io/archive/qt/4.3/qt-x11-opensource-src-4.3.2.tar.gz.mirrorlist Then I configured it with options:

./configure -platform linux-g++ -debug-and-release -qt-zlib -qt-libtiff -qt-libmng -qt-libjpeg -openssl -v -opengl -glib

After that I am trying to compile it with make and getting following error.

../../../include/QtCore/../../src/corelib/thread/qatomic.h: In instantiation of ‘QAtomicPointer<T>::QAtomicPointer(T*) [with T = QByteArray]’:
../../corelib/codecs/qsimplecodec.cpp:609:74:   required from here
../../../include/QtCore/../../src/corelib/thread/qatomic.h:207:7: error: ‘init’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../../../include/QtCore/../../src/corelib/thread/qatomic.h:207:7: note: declarations in dependent base ‘QBasicAtomicPointer<QByteArray>’ are not found by unqualified lookup
../../../include/QtCore/../../src/corelib/thread/qatomic.h:207:7: note: use ‘this->init’ instead
make[1]: *** [.obj/release-shared/qsimplecodec.o] Error 1
make[1]: Leaving directory '/home/shraddha/shraddha/jst/QT/qt-x11-opensource-src-4.3.2/src/tools/rcc'
make: *** [sub-rcc-make_default-ordered] Error 2

Did I do anything wrong or leaving something?

回答1:

It gives you a hint what is wrong note: use ‘this->init. This happens with older code using templates not fully qualifying the access to class members with the this-> prefix. Either try to (a) add CXXFLAGS='-fpermissive' to your environment before configuring, or (b) get a newer Qt Version or (c) an older compiler (kidding).