Important: Please read the Qt Code of Conduct -

Redefinition errors in QDeclarativeItem.h and QQml.h in Qt 5.2

  • I'm getting a lot of redefinition errors in my app which uses qqml and qdeclarativeitem classes. Simply because both of them are in the same namespace.

    /Applications/Qt5.2.0/5.2.0/clang_64/lib/QtDeclarative.framework/Headers/qdeclarative.h:89: error: redefinition of 'qmlRegisterType'
    int qmlRegisterType()

    /Applications/Qt5.2.0/5.2.0/clang_64/lib/QtQml.framework/Versions/5/Headers/qqml.h:107: previous definition is here
    int qmlRegisterType()


    magically returns the Documents folder.

    And on Windows this

    returns the Start Menu folder, where normally shortcuts to apps are, not installed apps.

    What can I do?

  • Moderators

    You should be using QtQml together with QtQuick. QtDeclarative is the old engine.

Log in to reply