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. qrc resources to be compiled
Qt 6.11 is out! See what's new in the release blog

qrc resources to be compiled

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 3.8k 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.
  • I Offline
    I Offline
    iolanda
    wrote on last edited by
    #1

    Hi,
    I'm brand new on Qt and C++ programming in general....I'm trying to generate an .exe file to run my software without having to run it through Qt.
    0_1513637633117_8b3bb08b-f363-4736-8762-61f136db6e90-image.png
    here is how my project looks like, with the list of files and the qrc resource attached. Now, if I run the project from Qt everything is ok, but if I try to run the .exe created into the release folder I get "MAP file NOT FOUND", warning I set up in case the file is missing....any clue on why this happens and how can I fix it?

    Thanks a lot in advance
    Iolanda

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you getting that error message when trying to load that file from QRC ? That seems highly unlikely since the resource file is compiled in your application.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • I Offline
        I Offline
        iolanda
        wrote on last edited by
        #3

        thank you for your quick reply! I do get the error when I run the application (and the project doesn't work as it should) but it works fine, and I don't get any error, if I run the project from Qt.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Just to be sure, when you say your run the exe from the release folder, are you launching it from Window's file explorer ? If so, did you properly deploy your application ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • I Offline
            I Offline
            iolanda
            wrote on last edited by
            #5

            this is what I do:

            1. I run my project from Qt 0_1513670282772_a1ca134d-46f8-484f-a07e-06c4748dc462-image.png
            2. the software creates the folder where it deploys the application along with all the moc_xx.cpp and the qrc_MapFile.cpp is there 0_1513670466273_c8bb8a50-4912-462e-ac97-3b94b61d9425-image.png
            3. I copy the .exe from the deploy folder into the folder from where I want to launch the application 0_1513670614395_5281394f-b400-4455-a5dd-4b726c5bae9e-image.png
              at least this is what I have successfully done with other projects but this is the first time I use a .qrc resource.

            sorry for all the screenshots but hopefully would be easier to understand if I'm missing pieces...

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Can you show the content of your .qrc file ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • I Offline
                I Offline
                iolanda
                wrote on last edited by
                #7

                sure! the .qrc is

                <RCC>
                <qresource prefix="/MapFile">
                <file>DUO-Map.map</file>
                </qresource>
                </RCC>

                and the .map file is just a list of numbers

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by SGaist
                  #8

                  Looks good...

                  Can you show the code where you load the file ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • I Offline
                    I Offline
                    iolanda
                    wrote on last edited by
                    #9

                    yep...
                    void MainWindow::ReadMap()
                    {
                    QFile file(":/MapFile/DUO-Map.map");
                    if(file.exists()!=true){
                    qDebug()<<"MAP FILE NOT FOUND.";
                    return;
                    }

                    1 Reply Last reply
                    0
                    • I Offline
                      I Offline
                      iolanda
                      wrote on last edited by
                      #10

                      Hi SGaist I solved the issue by deploying the application from the command line using the command windeployqt.exe and it works fine. thanks fro your help anyway!

                      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