PDA

View Full Version : QMetaType::registerType: Binary compatibility break — Size mismatch for type ‘QPaintB



jiapei100
21st February 2013, 13:48
Hi, all:


I'm testing Qt5 . I have Qt5 installed at /opt/Qt5.0.1 (still with some Qt4 libraries installed at /usr/lib/i386-linux-gnu/ ) .
However, whenever I tried to run my program, I got the following error message:



QMetaType::registerType: Binary compatibility break -- Size mismatch for type 'QPaintBufferCacheEntry' [1024]. Previously registered size 0, now registering size 12.
Aborted (core dumped)

People gave out several solutions, including:
1) make distclean ( refer to https://groups.google.com/forum/?fromgroups=#!topic/sdr-widget/HTVYpo05-vw )
2) I can't see a solution but the topic has already been closed here
( https://bugreports.qt-project.org/browse/QTBUG-27104?page=com.atlassian.jira.plugin.system.issuet abpanels:all-tabpanel )


In addition,



$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/Qt5.0.1/5.0.1/gcc/bin

In my project .pro,


LIBS += -L/usr/lib \

# -L/usr/lib/i386-linux-gnu \

-L/opt/Qt5.0.1/5.0.1/gcc/lib \

clearly, I don't have Qt4 libraries linked, but only Qt5 library path included.










So, how to solve this problem? Thanks.


Pei

Added after 25 minutes:

It seems my problem comes from the newly installed Qt, due to the reason that I have Qt5 installed under /opt/Qt5 .
However, in my .pro file,

CONFIG += qt warn_on debug staticlib

How can I make sure this project is able to find my manually installed Qt5 ?

For now, the error

fatal error: QGraphicsView: No such file or directory
is telling I'm not able to find Qt5 ...


cheers
Pei

wysota
21st February 2013, 13:57
Path to Qt is embedded in qmake. So if you use qmake from Qt4, it will use Qt4, if you use qmake from Qt5, it will use Qt5.

jiapei100
21st February 2013, 21:27
Thanks wysota:

Firstly:
As you can see, I have

bq. $ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/Qt5.0.1/5.0.1/gcc/bin


which means, I'm using qt5-qmake already !! In fact, I don't even have a 2nd qmake under /usr/bin



Secondly:
I guess the problem comes with QT configuration !! If I modify my original code from

#include <QWidget>
to

#include <QtWidgets/QWidget>,
everything compiles !!!
Which seems to hint after I successfully Qt5,
CONFIG += qt doesn't configure Qt correctly.

Anyway, I can compile my program now. But, how to solve the Qt configuration issue?


Cheers
Pei

wysota
21st February 2013, 22:25
I don't know what you are using just by seeing the path order. Invoke qmake -v and see for yourself what you are using. As for the compilation -- if you want to use widgets, make sure your project file contains a QT += widgets entry and rerun qmake.

jiapei100
21st February 2013, 23:08
Hi, thank you so much for your prompt reply wysota.

1)

$ qmake -v
QMake version 3.0
Using Qt version 5.0.1 in /opt/Qt5.0.1/5.0.1/gcc/lib
which means I'm using qt5.


QT += Widgets should make the trick. However, I got some new issues about qwt.


2) I'm now trying to build qwt with new qt5 qmake. However, I don't know how to specify the installation folder ? I tried:

qmake prefix=/usr
make
make install
However, qwt is always installed to /usr/local/qwt-6.1.0-rc3/

3) Even if I specify

INCLUDEPATH += /usr/local/qwt-6.1.0-rc3/include \
in .pro file, the project is still not able to find qwt include file, such as

#include <qwt_painter.h>


please do help. I need qwt for my project. Thank you .


Best Regards
Pei






I don't know what you are using just by seeing the path order. Invoke qmake -v and see for yourself what you are using. As for the compilation -- if you want to use widgets, make sure your project file contains a QT += widgets entry and rerun qmake.

jiapei100
22nd February 2013, 13:11
Hi, wysota:

My qwt setting is of no problem now. However, this bug continues:


QMetaType::registerType: Binary compatibility break -- Size mismatch for type 'QPaintBufferCacheEntry' [1024]. Previously registered size 0, now registering size 12.
The program has unexpectedly finished.


Any suggestions please?


Thank you ...

Best Regards
Pei