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. Problem building .qrc file [SOLVED]
Qt 6.11 is out! See what's new in the release blog

Problem building .qrc file [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 5.2k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I'm attempting to compile all of the resources used in my application into the executable using the .qrc file. I have roughly 245 MB of files I need included in the .qrc (most of them are .3ds/.stl files with some image files). Previously I was using relative paths to load resources, but this won't work when associating file types with the installed executable. I'm encountering a problem when qmake attempts to build it:

    1> Rcc'ing Resources.qrc...
    1> In file ....\corelib\tools\qbytearray.cpp, line 1470: Out of memory

    After writing the line above, qmake exits. I've tried to increase the stack size from 1Mb to 5Mb, but it didn't change anything.

    I'm using Qt 4.8.3/MSVC 2010. Any suggestions would be appreciated!

    Thanks,
    Braden

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

      Hi,

      I think that what you are trying to achieve won't be possible (I may be wrong). rcc translate all your files in one c++ file. That file would really be quiet big since you have 245MB "uncompressed" data.

      Did you try to change the compression settings ? Or use the binary option ?

      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
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Thanks SGaist for your response. I read that by default rcc.exe uses compression, but I tried using:

        rcc.exe -compression 2 -threshold 3 /path/

        and that still didn't work. Using the binary option resulted in strange behavior, it actually crashed my command window, which I've never seen before.

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

          I would have tried 9 for compression. Anyway, as I said, trying to embed 245MB worth of data in an executable is not a good idea at all. You should rather have it as an external resource.

          What is your original solution to use these files ? And what doesn't work ?

          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
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Well, my original solution was that everything is referenced relatively. QIcon("./rsc/logo.ico"), etc.
            The reason I wanted to switch, was because I want the application to have the ability to recognize file types (akin to excel files). So that double clicking would open the application, but this causes a problem. When a file is double clicked, the application doesn't use the executable path, it uses the file path. So none of the images show up. The application works fine under normal circumstances.

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

              Why not use absolute path for these files ? You can use "this":http://qt-project.org/doc/qt-4.8/qcoreapplication.html#applicationDirPath then you should be able to access all the files you need

              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
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                That would work perfectly. Thanks so much. I didn't know that existed.

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

                  You're welcome !

                  Don't forget to update the thread's title to solved if that solution works for you :)

                  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

                  • Login

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