QMetaType::registerType: Binary compatibility break — Size mismatch for type ‘QPaintBufferCacheEntry’ [1024]. Previously registered size 0, now regist
-
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:bq. 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:
- make distclean ( refer to "https://groups.google.com/forum/?fromgroups=#!topic/sdr-widget/HTVYpo05-vw":https://groups.google.com/forum/?fromgroups=#!topic/sdr-widget/HTVYpo05-vw )
- 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.issuetabpanels:all-tabpanel":https://bugreports.qt-project.org/browse/QTBUG-27104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel )
In addition,
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/binIn my project .pro,
bq. 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
-
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,
[quote]CONFIG += qt warn_on debug staticlib[/quote]How can I make sure this project is able to find my manually installed Qt5 ?
For now, the error
[quote]fatal error: QGraphicsView: No such file or directory[/quote]
is telling I'm not able to find Qt5 ...cheers
Pei -
You have to use qmake from /opt/Qt5/bin, that should help to build things correctly
-
Yes, 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/binwhich means, I'm using qt5-qmake already !! In fact, I don't even have a 2nd qmake under /usr/bin
Any further suggestions?
Pei
-
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 -
For 5.0, QWidget has moved. It is now in QtWidgets and not QtGui anymore.
You have to add QT += widgets in your pro files -
Thank you so much SGaist...
However, problem continues:
bq. QMetaType::registerType: Binary compatibility break -- Size mismatch for type 'QPaintBufferCacheEntry' [1024]. Previously registered size 0, now registering size 12.
The program has unexpectedly finished.I've already solved Qt5 and Qwt (add feature) issue. However, the above error message keeps jumping out when I tried to run my program. Please do help...
thank you
Pei -
Something worth to try, check that you don't have Qt4 libs in your path when running your application
-
Hi, SGaist. You hit the point !!! ^_^
I'm running Ubuntu 12.10, in which some other packages rely on libqt4. Therefore, I didn't remove all qt4 packages.
In fact, for now, beside a full version of Qt5 installed under /opt/Qt5.0.1/5.0.1/gcc/lib
I still have some Qt4 packages installed at
@/usr/lib/i386-linux-gnu$ ls libQt*
libQt3Support.so.4 libQtDBus.so.4.8.3 libQtNetwork.so.4 libQtSvg.so.4.8
libQt3Support.so.4.8 libQtDeclarative.so.4 libQtNetwork.so.4.8 libQtSvg.so.4.8.3
libQt3Support.so.4.8.3 libQtDeclarative.so.4.8 libQtNetwork.so.4.8.3 libQtTest.so.4
libQtAssistantClient.prl libQtDeclarative.so.4.8.3 libQtOpenGL.so.4 libQtTest.so.4.8
libQtAssistantClient.so libQtDesignerComponents.so.4 libQtOpenGL.so.4.8 libQtTest.so.4.8.3
libQtAssistantClient.so.4 libQtDesignerComponents.so.4.8 libQtOpenGL.so.4.8.3 libQtWebKit.so.4
libQtAssistantClient.so.4.8 libQtDesignerComponents.so.4.8.3 libQtScript.so.4 libQtWebKit.so.4.9
libQtAssistantClient.so.4.8.1 libQtDesigner.so.4 libQtScript.so.4.8 libQtWebKit.so.4.9.0
libQtCLucene.so.4 libQtDesigner.so.4.8 libQtScript.so.4.8.3 libQtXmlPatterns.so.4
libQtCLucene.so.4.8 libQtDesigner.so.4.8.3 libQtScriptTools.so.4 libQtXmlPatterns.so.4.8
libQtCLucene.so.4.8.3 libQtGui.so.4 libQtScriptTools.so.4.8 libQtXmlPatterns.so.4.8.3
libQtCore.so.4 libQtGui.so.4.8 libQtScriptTools.so.4.8.3 libQtXml.so.4
libQtCore.so.4.8 libQtGui.so.4.8.3 libQtSql.so.4 libQtXml.so.4.8
libQtCore.so.4.8.3 libQtHelp.so.4 libQtSql.so.4.8 libQtXml.so.4.8.3
libQtDBus.so.4 libQtHelp.so.4.8 libQtSql.so.4.8.3
libQtDBus.so.4.8 libQtHelp.so.4.8.3 libQtSvg.so.4
@So, is there a way for me to specify which Qt(5 or 4) I would like to use?
Cheers
Pei -
Check "man ld", it will explain how you can modify the library loading i.e. before starting your program
-
Hi,
g++ is the compiler, ld is the library loader, they don't act at the same moment.
Does you application use an external library that is linked against Qt 4 ?
-
Thank you for your reply.
I checked that before but can't find any link to Qt4.
I have installed Qt5.1.1, but as I have seen in this post before, also my Linux is having Qy4 libraries in the /usr/lib.The last action from Qt while building the app is:
g++ -Wl,-rpath,/home/infologic/Qt5.1.1/5.1.1/gcc -Wl,-rpath,/home/infologic/Qt5.1.1/5.1.1/gcc/lib -o demo-player DemoPlayer.o main.o Enums.o Common.o Instance.o Error.o moc_DemoPlayer.o moc_Instance.o -lvlc -Wl,-rpath-link,/home/infologic/Qt5.1.1/5.1.1/gcc/lib -L/home/infologic/Qt5.1.1/5.1.1/gcc/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
{ test -n "" && DESTDIR="" || DESTDIR=.; } && test $(gdb --version | sed -e 's,[^0-9]+([0-9]).([0-9]).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $DESTDIR" -ex quit 'demo-player' && test -f demo-player.gdb-index && objcopy --add-section '.gdb_index=demo-player.gdb-index' --set-section-flags '.gdb_index=readonly' 'demo-player' 'demo-player' && rm -f demo-player.gdb-index || trueMaybe you can find something out of this?
Thanks in advance.
-
The ldd of the release returns:
ldd demo-player
linux-gate.so.1 (0xb77c2000)
libvlc.so.5 => /usr/lib/libvlc.so.5 (0xb7785000)
libQt5Widgets.so.5 => /home/infologic/Qt5.1.1/5.1.1/gcc/lib/libQt5Widgets.so.5 (0xb7159000)
libQt5Gui.so.5 => /home/infologic/Qt5.1.1/5.1.1/gcc/lib/libQt5Gui.so.5 (0xb6cee000)
libQt5Core.so.5 => /home/infologic/Qt5.1.1/5.1.1/gcc/lib/libQt5Core.so.5 (0xb686a000)
libGL.so.1 => /usr/lib/libGL.so.1 (0xb680b000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb67f0000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6704000)
libm.so.6 => /lib/libm.so.6 (0xb66c2000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb66a4000)
libc.so.6 => /lib/libc.so.6 (0xb6529000)
libvlccore.so.5 => /usr/lib/libvlccore.so.5 (0xb6429000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb63da000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb62dc000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb61a2000)
libicui18n.so.51 => /home/infologic/Qt5.1.1/5.1.1/gcc/lib/libicui18n.so.51 (0xb5f7f000)
libicuuc.so.51 => /home/infologic/Qt5.1.1/5.1.1/gcc/lib/libicuuc.so.51 (0xb5e06000)
libdl.so.2 => /lib/libdl.so.2 (0xb5e01000)
libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb5dfe000)
librt.so.1 => /lib/librt.so.1 (0xb5df5000)
/lib/ld-linux.so.2 (0xb77c3000)
libglapi.so.0 => /usr/lib/libglapi.so.0 (0xb5dde000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb5dcb000)
libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xb5dc7000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb5dc1000)
libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0xb5dbe000)
libxcb-glx.so.0 => /usr/lib/libxcb-glx.so.0 (0xb5da4000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb5d81000)
libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0xb5d7b000)
libdrm.so.2 => /usr/lib/libdrm.so.2 (0xb5d6d000)
libdbus-1.so.3 => /lib/libdbus-1.so.3 (0xb5d21000)
libffi.so.4 => /usr/lib/libffi.so.4 (0xb5d1a000)
libpcre.so.1 => /usr/lib/libpcre.so.1 (0xb5cb6000)
libicudata.so.51 => /home/infologic/Qt5.1.1/5.1.1/gcc/lib/libicudata.so.51 (0xb476d000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb4769000) -
While testing around I found out that the Qt4 is installed in /usr/include, /usr/lib and Qt5 not.
However, I do not see a possibility to install Qt5 in these directories. My KDE is using Qt4.As above, how can I force to only use Qt5 in my demo program?
I also included the -I flag, but when checking the folders it still uses the /usr/include having the Qt4 files. -
Please use codings tags when posting code/ldd output etc... It will make them readable.
Don't try to put the two sets of include/libraries in the same folders.
Qt 5 is good where it is. Try to run your program with QT_DEBUG_PLUGINS=1 to see what plugins are loaded (i.e. the theme plugin) and check them to see whether one of them pulls Qt4 in
-
I have added the arguments, and the compile output gives:
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIE -DQT_DEBUG_PLUGINS=1Running the application gives:
Starting /home/infologic/workspace/cpp/infologic/demo-player/demo-player...
Started
QMetaType::registerType: Binary compatibility break -- Size mismatch for type 'QPaintBufferCacheEntry' [1024]. Previously registered size 12, now registering size 0.
The program has unexpectedly finished.
/home/infologic/workspace/cpp/infologic/demo-player/demo-player exited with code 0It seems it crashes before loading the plugins.
I managed to force Qt to only use include files from Qt5.
-
Not build, run your program with QT_DEBUG_PLUGINS=1
-
I have found the reason. I created a new project, and that one gave me a backtrack.
It's loading the libqt4_plugin.so, which is causing the troubles.
Removing this file from the plugins dir solves the crash!I copied the plugins dir, removed the gui subdir and set the environment var VLC_PLUGIN_PATH=<new dir>
-
That might indeed happen with all libraries that uses Qt (qca comes into mind)
Glad you found out.
Happy coding :)