Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Redefinition errors in QDeclarativeItem.h and QQml.h in Qt 5.2
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fallen Zen
    wrote on last edited by
    #1

    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()

    Also
    @QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)@

    magically returns the Documents folder.

    And on Windows this
    @QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)@

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

    What can I do?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

      (Z(:^

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved