Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Error after creating new QML file.
Forum Updated to NodeBB v4.3 + New Features

Error after creating new QML file.

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 5 Posters 5.1k Views 2 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.
  • C Offline
    C Offline
    cubicap
    wrote on 27 Jun 2019, 18:11 last edited by cubicap 9 Mar 2019, 18:37
    #1

    I am working on an application using QML and Qt Creator.

    Everything works as expected until I create a new QML file (in this case called RegistryEntryString.qml but the name does not matter). It is just plain new QML.

    import QtQuick 2.0
    
    Item {
    
    }
    

    After that, when I try to run the application, the following pops up in issues:

    qmlcache_loader.cpp:-1: error: undefined reference to `QmlCacheGeneratedCode::_0x5f__RegistryEntryString_qml::qmlData'
    File not found: qmlcache_loader.cpp
    

    I cannot find meaning and source of this error.
    Restarting Qt Creator does not help. Cleaning the project does not help either.

    When I remove the file, however, everything is fine again.

    Any help with this problem will be greatly appreciated.

    EDIT:
    Just to clarify, I am using Qt 5.12.3.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 27 Jun 2019, 19:11 last edited by
      #2

      Sounds like a bug and I have never seen it.

      But maybe this will help: you can manually clear QML cache - just remove all cache files from cache location.

      Also, make sure you use some modern Qt version.

      (Z(:^

      1 Reply Last reply
      0
      • C Offline
        C Offline
        closx
        wrote on 28 Jun 2019, 13:32 last edited by
        #3

        Yeah, got what is wrong. Qt tries to run your old build, but qrc files does no match.
        All you have to do is,
        1- Be sure you have added your new qml file to qrc.
        2- Delete your build folder (probably the same folder as your source folder)
        3- Build again.

        bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
        tag me (like @closx) if you are answering to me, so I can notice :D

        1 Reply Last reply
        1
        • C Offline
          C Offline
          cubicap
          wrote on 3 Sept 2019, 18:32 last edited by cubicap 9 Mar 2019, 18:45
          #4

          Thank you very much.

          Sorry to reply this late, I was away and didn't get an email notification.

          The problem is really caused by some file, which is used, being old. I got it working by modifying the properties file (adding a space and removing it) which probably triggered a clean build and caused similar outcome as you have described.

          The behavior seems like a bug to me.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            timday
            wrote on 27 Feb 2020, 20:36 last edited by
            #5

            Just ran into this one myself while hopping a build around between Qt versions. Googling error message led here.

            Problem seemed to be a qmlcache_loader.cpp file spat out by the resources system. I thought I was cleaning up all the auto-generated rcc/qrc-related files when changing version, but either hadn't noticed this one before (appears sometime between Qt5.7 and Qt5.10?) or hadn't an issue with it. Adding it to the list of things my "deep clean" script trashes fixed my build.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Andarang
              wrote on 21 Jan 2021, 09:16 last edited by
              #6

              I stumbled upon this today using MinGW (I've been usually using MSVC)... anyway, yeah, it's trying to build with old files and it doesn't find the newly created one. A simple rebuild does the trick.

              1 Reply Last reply
              1

              • Login

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