Error building QML-Box2D Library
-
I followed the instructions on the qt wiki page Build-QML-Box2D-Library but get the following compiler error when I try to build in Qt Creator:
C:\Qt\5.4\mingw491_32\include\QtCore\qglobal.h:694: error: invalid application of 'sizeof' to incomplete type 'QStaticAssertFailure<false>'
enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, COUNTER) = sizeof(QStaticAssertFailure<!!(Condition)>)}I am using Qt Creator 3.4.1 (opensource) / Based on Qt 5.4.2 (MSVC 2013, 32 bit) with the MinGW 4.9.1 32 bit compiler.
Full debug output:
In file included from ....\include/QtCore/qnamespace.h:37:0,
from ....\include/QtCore/qobjectdefs.h:41,
from ....\include/QtCore/qobject.h:40,
from ....\include/QtCore/qplugin.h:37,
from ....\include\QtDeclarative/qdeclarativeextensionplugin.h:37,
from ....\include\QtDeclarative/QDeclarativeExtensionPlugin:1,
from box2dplugin.h:29,
from box2dplugin.cpp:28:
....\include/QtCore/qglobal.h:694:121: error: invalid application of 'sizeof' to incomplete type 'QStaticAssertFailure<false>'
enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, COUNTER) = sizeof(QStaticAssertFailure<!!(Condition)>)}
^
....\include/QtCore/qglobal.h:699:47: note: in expansion of macro 'Q_STATIC_ASSERT'
#define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
^
....\include/QtCore/qplugin.h:136:5: note: in expansion of macro 'Q_STATIC_ASSERT_X'
Q_STATIC_ASSERT_X(false, "Old plugin system used")
^
box2dplugin.cpp:61:1: note: in expansion of macro 'Q_EXPORT_PLUGIN2'
Q_EXPORT_PLUGIN2(Box2DPlugin, Box2DPlugin)
^
....\include/QtCore/qglobal.h:694:122: error: expected unqualified-id at end of input
enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, COUNTER) = sizeof(QStaticAssertFailure<!!(Condition)>)}
^
....\include/QtCore/qglobal.h:699:47: note: in expansion of macro 'Q_STATIC_ASSERT'
#define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
^
....\include/QtCore/qplugin.h:136:5: note: in expansion of macro 'Q_STATIC_ASSERT_X'
Q_STATIC_ASSERT_X(false, "Old plugin system used")
^
box2dplugin.cpp:61:1: note: in expansion of macro 'Q_EXPORT_PLUGIN2'
Q_EXPORT_PLUGIN2(Box2DPlugin, Box2DPlugin)
^ -
Hi and welcome to devnet,
IIRC, the current sources should be fetched from here