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. Large number of PNG resources --> [qrc_resources.cpp] Segmentation fault: 11
Forum Updated to NodeBB v4.3 + New Features

Large number of PNG resources --> [qrc_resources.cpp] Segmentation fault: 11

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 1.8k 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.
  • H Offline
    H Offline
    Hoyt
    wrote on last edited by
    #1

    I am developing a desktop application that contains many animations. I am developing the program on an Apple iMac.

    The QT project includes a qml.qrc file that references 10 qml files. The project also contains a resources.qrc file that references png files. The resources.qrc file does not reference any missing files.

    Until today, the resources.qrc file referenced about 50mb of png files. The program development was without any issues. However, today, I added I added an additional 460mb of "production" png files. To be precise, there are 2,089 png files having a cumulative size of 504mb.

    Now, when I attempt to build the project, I receive the following error:

                     "[qrc_resources.cpp] Segmentation fault: 11"  
    

    I have reviewed the contents of the resources.qrc file, and I see nothing amiss.

    Is there a limit to the number of files or the cumulative size of files that can be referenced by a qrc file? Should I spread my png files out among a large number of separate qrc files?

    Thank you in advance.

    Hoyt

    kshegunovK 1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi!

      The size limit depends on your C++ compiler: The resource file (*.qrc) is only a XML file that lists all the PNGs etc you added to it. Then comes Qt's resource compiler into play: It generates a C++ file for each XML file. These C++ files contain a C array for each of the listed files (PNGs etc). These C arrays contain the binary data of that files (PNGs etc). So, the more data (more files, bigger files) you add to a resource file, the bigger the corresponding C++ file will become. And your C++ compiler (MSVC, gcc, etc) usually can't handle arbitrary huge files.

      Long story short: Don't compile huge amounts of data into your executable; better put them in a folder and deploy that along with your executable. (Or, if you want to "protect" them, put them in a zip archive.)

      1 Reply Last reply
      3
      • H Hoyt

        I am developing a desktop application that contains many animations. I am developing the program on an Apple iMac.

        The QT project includes a qml.qrc file that references 10 qml files. The project also contains a resources.qrc file that references png files. The resources.qrc file does not reference any missing files.

        Until today, the resources.qrc file referenced about 50mb of png files. The program development was without any issues. However, today, I added I added an additional 460mb of "production" png files. To be precise, there are 2,089 png files having a cumulative size of 504mb.

        Now, when I attempt to build the project, I receive the following error:

                         "[qrc_resources.cpp] Segmentation fault: 11"  
        

        I have reviewed the contents of the resources.qrc file, and I see nothing amiss.

        Is there a limit to the number of files or the cumulative size of files that can be referenced by a qrc file? Should I spread my png files out among a large number of separate qrc files?

        Thank you in advance.

        Hoyt

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by kshegunov
        #3

        @Hoyt, in addition to @Wieland, you should use external resources and not compile everything into 500MB executable files. This thread from the mailing list will help you get your bearings.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        3

        • Login

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