Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • 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

  • Moderators

    @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


  • Moderators

    @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



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


  • Lifetime Qt Champion

    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?


  • Moderators

    @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)



  • 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.


  • Lifetime Qt Champion

    @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.



  • 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.


  • Lifetime Qt Champion

    @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



  • @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?


  • Lifetime Qt Champion

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

    Do you mean inside a QML file or where ?


Log in to reply