What is correct way to solve the build error while making static libraries of Qt

倾然丶 夕夏残阳落幕 提交于 2019-12-25 09:08:08

问题


I am also making static library of Qt (qt.4.3.3) , the steps to do the same are

I downloaded a open source of qt-all-opensource-src-4.3.3. I built static libraries using following steps. The gcc version I am using is gcc 5.2.0

cd qt-all-opensource-src-4.3.3
gmake conflcean
./configure -release -static -largefile -qt3support -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -glib -platform linux-g++-64 -confirm-license -no-openssl -no-qdbus -prefix ./static_new -prefix-install -opengl -sm -lSM -lICE -xshape -lX11 -xinerama -lXinerama -xcursor -lXcursor -xfixes -lXfixes -xrandr -lXrandr -xrender -lXrender -fontconfig -lfontconfig -tablet -lXi -xkb -glib -lglib-2.0 -lXext -lz -lgthread-2.0
gmake
gmake install

I am getting following error message

from ../../corelib/codecs/qsimplecodec_p.h:36,
                 from ../../corelib/codecs/qsimplecodec.cpp:22:
../../../include/QtCore/../../src/corelib/thread/qatomic.h: In instantiation of ?QAtomicPointer<T>::QAtomicPointer(T*) [with T = QByteArray]?:
../../corelib/codecs/qsimplecodec.cpp:592:74:   required from here                                                                                                                                                                                                                                  
../../../include/QtCore/../../src/corelib/thread/qatomic.h:190: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:190:7: note: declarations in dependent base ?QBasicAtomicPointer<QByteArray>? are not found by unqualified lookup
../../../include/QtCore/../../src/corelib/thread/qatomic.h:190:7: note: use ?this->init? instead
gmake[1]: *** [.obj/release-static/qsimplecodec.o] Error 1
gmake[1]: Leaving directory `/in/inndt69/Projects/oasys/QT/QT/qt-x11-commercial-src-4.3.3/qt-x11-commercial-src-4.3.3/src/tools/rcc'
gmake: *** [sub-rcc-make_default-ordered] Error 2

What is exact cause of this build error?

I went through Building Qt-4.3.2 from source on Linux machine but I am not sure if only these two are proper way to solve this problem

A comment from the above answer:

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).

My questions are:

  1. What is exact cause of this build error ?

  2. I am not sure if compiling Qt code with CXXFLAGS='-fpermissive will not cause any side effects in future.?

来源:https://stackoverflow.com/questions/39844038/what-is-correct-way-to-solve-the-build-error-while-making-static-libraries-of-qt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!