我想用 libQtCore.a 的两个版本检查目标代码

I want to check object code with two versions of libQtCore.a

我也在做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); 的更正代码进行比较吗? } 在导致错误的行中。

您遇到错误是因为您使用的非常旧的 Qt 代码不是有效的 C++:旧的编译器更加宽松并接受该无效代码。您必须修补您的 Qt 副本才能修复该错误。