PDA

View Full Version : QMetaType::registerType: Binary compatibility break -- Size mismatch for type 'QPaint



dalishi
24th June 2015, 05:38
Dear all

I manage to compile my code with Qt 5 but when I run the program and encountered the following error:


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


I have googled for a few days and did not find any luck. Anyone could help me with this? Thanks in advance. I am running Qt5 on ubuntu 14.04 64bit.

The source code is simple from sample code of the marble library (a globe map library):


#include <QtWidgets/QApplication>
#include <marble/MarbleWidget.h>

int main(int argc, char** argv)
{
QApplication app(argc, argv);

// Load Marble using OpenStreetMap in Mercator projection
Marble::MarbleWidget *mapWidget = new Marble::MarbleWidget;
mapWidget->setProjection(Marble::Mercator);
mapWidget->setMapThemeId("earth/openstreetmap/openstreetmap.dgml");

mapWidget->setWindowTitle("Hello Marble!");
mapWidget->show();
return app.exec();
}

My cmake file to build is below:

CMAKE_MINIMUM_REQUIRED (VERSION 2.8.11)
SET (TARGET hello-marble)
PROJECT (${TARGET})

# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)

# Find the Qt modules library
find_package(Qt5Widgets REQUIRED)

SET (QT_LIBRARIES ${QT_LIBRARIES} Qt5::Widgets)
SET (MARBLE_LIBRARIES ${MARBLE_LIBRARIES} marblewidget)
SET (LIBS ${LIBS} ${MARBLE_LIBRARIES} ${QT_LIBRARIES})

ADD_EXECUTABLE (${TARGET} marble_test.cpp)
TARGET_LINK_LIBRARIES (${TARGET} ${LIBS})

My gdb traceback of my code is:


Program received signal SIGABRT, Aborted.
0x00007ffff56d1cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff56d1cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff56d50d8 in __GI_abort () at abort.c:89
#2 0x00007ffff600ab76 in QMessageLogger::fatal(char const*, ...) const () from /home/zq/Qt5.4.0/5.4/gcc_64/lib/libQt5Core.so.5
#3 0x00007ffff6266175 in QMetaType::registerNormalizedType(QByteArray const&, void (*)(void*), void* (*)(void const*), void (*)(void*), void* (*)(void*, void const*), int, QFlags<QMetaType::TypeFlag>, QMetaObject const*) ()
from /home/zq/Qt5.4.0/5.4/gcc_64/lib/libQt5Core.so.5
#4 0x00007ffff677dc5a in ?? () from /home/zq/Qt5.4.0/5.4/gcc_64/lib/libQt5Gui.so.5
#5 0x00007ffff7dea13a in call_init (l=<optimized out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffdb58, env=env@entry=0x7fffffffdb68) at dl-init.c:78
#6 0x00007ffff7dea223 in call_init (env=<optimized out>, argv=<optimized out>, argc=<optimized out>, l=<optimized out>) at dl-init.c:36
#7 _dl_init (main_map=0x7ffff7ffe1c8, argc=1, argv=0x7fffffffdb58, env=0x7fffffffdb68) at dl-init.c:126
#8 0x00007ffff7ddb30a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#9 0x0000000000000001 in ?? ()
#10 0x00007fffffffdf7a in ?? ()
#11 0x0000000000000000 in ?? ()

anda_skoa
24th June 2015, 10:12
Check the build output, maybe you are accidentally linking against an incompatible version of Marble, e.g. its Qt4 version.

Cheers,
_

dalishi
25th June 2015, 09:42
Thanks anda

I compiled marble with Qt4 instead and it worked. Maybe the marble now does not support Qt5.

anda_skoa
25th June 2015, 11:11
I am pretty sure it can be built with both Qt versions.
Its CMakeList.txt file has sections for each version
https://projects.kde.org/projects/kde/kdeedu/marble/repository/revisions/master/entry/CMakeLists.txt

Cheers,
_