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. Strange things are happening, C1060 compiler is out of heap space
Forum Updated to NodeBB v4.3 + New Features

Strange things are happening, C1060 compiler is out of heap space

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 3 Posters 847 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #1

    So there is one TTF file referenced by the QML:

    Main {
        id: main
        anchors.fill: parent
        FontLoader {
            source: 'qrc:/malgun.ttf'
        }
    }
    

    The issue is, in the previous Qt4.8 version of this project there was no resource file, everything was specified in the .pro file.

    I have created a qresources.qrc and this is the last file I added, when I add this file to 'qresources.qrc' it creates an entry:

    <file>malgun.ttf</file>
    

    When the XML file is opened with the Plain text editor it is a total of 536 lines, this includes all the QML and images files for the project.

    The issue is after adding this font file the application now reports an issue:

    C1060: compiler is out of heap space
    [Full path of qrc_qresources.cpp] 06873
    

    Kind Regards,
    Sy

    J.HilkJ 1 Reply Last reply
    0
    • SPlattenS SPlatten

      So there is one TTF file referenced by the QML:

      Main {
          id: main
          anchors.fill: parent
          FontLoader {
              source: 'qrc:/malgun.ttf'
          }
      }
      

      The issue is, in the previous Qt4.8 version of this project there was no resource file, everything was specified in the .pro file.

      I have created a qresources.qrc and this is the last file I added, when I add this file to 'qresources.qrc' it creates an entry:

      <file>malgun.ttf</file>
      

      When the XML file is opened with the Plain text editor it is a total of 536 lines, this includes all the QML and images files for the project.

      The issue is after adding this font file the application now reports an issue:

      C1060: compiler is out of heap space
      [Full path of qrc_qresources.cpp] 06873
      
      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by J.Hilk
      #2

      @SPlatten not overly surprising,

      What Qt's ressource system does is, read your specified files and compiles them as raw binary data into your executable.

      ttf files are notoriously big, because of their high quality.

      You can try splitting your resource file up, see if that solves your issue (You can still access the files the same way, regardless how many different (or differently named) resource files you have.

      See if that helps. If it doesn't, then your file is simply too big for the resource system. I would suggest downscaling it then :D


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      SPlattenS 1 Reply Last reply
      2
      • J.HilkJ J.Hilk

        @SPlatten not overly surprising,

        What Qt's ressource system does is, read your specified files and compiles them as raw binary data into your executable.

        ttf files are notoriously big, because of their high quality.

        You can try splitting your resource file up, see if that solves your issue (You can still access the files the same way, regardless how many different (or differently named) resource files you have.

        See if that helps. If it doesn't, then your file is simply too big for the resource system. I would suggest downscaling it then :D

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by
        #3

        @J-Hilk Thanks, I'll give it a go.

        Kind Regards,
        Sy

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

          Hi
          Are truetype font files big ??
          My entire font folder with hundreds of fonts is like 50 MB.
          Are you thinking of TIFF files or did i completely miss something?

          J.HilkJ 1 Reply Last reply
          1
          • mrjjM mrjj

            Hi
            Are truetype font files big ??
            My entire font folder with hundreds of fonts is like 50 MB.
            Are you thinking of TIFF files or did i completely miss something?

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @mrjj said in Strange things are happening, C1060 compiler is out of heap space:

            Hi
            Are truetype font files big ??
            My entire font folder with hundreds of fonts is like 50 MB.
            Are you thinking of TIFF files or did i completely miss something?

            you're absolutely right! I was reading tiff instead of ttf. My bad 🙈
            Those are indeed usually not big, So my guess is then, that the whole resource file is to big and not that one single Font(and not image)


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            1 Reply Last reply
            0
            • SPlattenS Offline
              SPlattenS Offline
              SPlatten
              wrote on last edited by SPlatten
              #6

              This ttf file is 13142 KB. I've just got done, putting the ttf in its own qrc file and rebuilt project. It has solved the issue.

              Kind Regards,
              Sy

              mrjjM 1 Reply Last reply
              1
              • SPlattenS SPlatten

                This ttf file is 13142 KB. I've just got done, putting the ttf in its own qrc file and rebuilt project. It has solved the issue.

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #7

                @SPlatten said in Strange things are happening, C1060 compiler is out of heap space:

                13142

                That is actually kinda big for a font file.
                So I think @J-Hilk is right and you hit the resource file limit.

                1 Reply Last reply
                0
                • SPlattenS Offline
                  SPlattenS Offline
                  SPlatten
                  wrote on last edited by
                  #8

                  Well I spoke to soon, now its complaining with exactly the same message. Not sure what to do now, that second resource file only contains the font.

                  Kind Regards,
                  Sy

                  mrjjM 1 Reply Last reply
                  0
                  • SPlattenS SPlatten

                    Well I spoke to soon, now its complaining with exactly the same message. Not sure what to do now, that second resource file only contains the font.

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @SPlatten
                    Could try some other tff file from your system and see ?

                    If it really is the font files that make it too big, then maybe compile it as an external resource file and load it at run time.
                    https://doc.qt.io/qt-5/resources.html
                    the
                    External Binary Resources section

                    1 Reply Last reply
                    0
                    • SPlattenS Offline
                      SPlattenS Offline
                      SPlatten
                      wrote on last edited by
                      #10

                      @mrjj , looking at the link, I can see how to setup an external resource:

                      QResource::registerResource("/path/to/myresource.rcc");
                      

                      What does the QML resource link look like, is it just a file path?

                      Kind Regards,
                      Sy

                      mrjjM 1 Reply Last reply
                      0
                      • SPlattenS SPlatten

                        @mrjj , looking at the link, I can see how to setup an external resource:

                        QResource::registerResource("/path/to/myresource.rcc");
                        

                        What does the QML resource link look like, is it just a file path?

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        What does the QML resource link look like, is it just a file path?

                        Do you mean inside a QML file or where ?

                        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