【发布时间】:2016-10-12 00:04:16
【问题描述】:
我也在做 Qt (qt.4.3.3) 的静态库,做同样的步骤是
我下载了一个开源的qt-all-opensource-src-4.3.3。我使用以下步骤构建了静态库。我使用的 gcc 版本是 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
我收到以下错误消息
来自 ../../corelib/codecs/qsimplecodec_p.h:36,
来自../../corelib/codecs/qsimplecodec.cpp:22:
../../../include/QtCore/../../src/corelib/thread/qatomic.h:在 ?QAtomicPointer::QAtomicPointer(T*) [with T = QByteArray] 的实例化中?:
../../corelib/codecs/qsimplecodec.cpp:592:74:从这里需要
../../../include/QtCore/../../src/corelib/thread/qatomic.h:190:7: 错误:?init?未在此范围内声明,并且在实例化点通过依赖于参数的查找未找到任何声明 [-fpermissive]
../../../include/QtCore/../../src/corelib/thread/qatomic.h:190:7:注意:在依赖基础?QBasicAtomicPointer?未通过不合格查找找到
../../../include/QtCore/../../src/corelib/thread/qatomic.h:190:7:注意:使用 ?this->init?反而
gmake[1]: * [.obj/release-static/qsimplecodec.o] 错误 1
gmake[1]:离开目录`/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] 错误 2
听从What is correct way to solve the build error while making static libraries of Qt的建议
我做了两个实验
1) Experiment1 : compiled the Qt4.3.3 with -fpermissive flag and I got version of libQtCore.a
2) Experiment2 : corrected the code and used this-init insted of init at line 190 and build passed
现在我必须比较使用两个版本的 libQtCore(来自两个实验)生成的目标代码。我尝试使用以下命令
1) objdump -t /pathtoQt/experiment1/libQtCore.a | grep -i atomic
1) objdump -t /pathtoQt/experiment2/libQtCore.a | grep -i atomic
但我在 objdumps 中没有得到任何 QAtomicPointer 的引用。
有人可以指导我如何将使用 -fpermissive 标志生成的目标代码与使用 { this->init(t); 的更正代码进行比较} 在导致错误的行中。
【问题讨论】:
标签: c++ qt templates objdump nm