0

I'm compiling a QtQuick application using Visual Studio 2019. I built a basic interface which is running well. The interface itself is very simple for now, it's just 3 labels. At this point my project compiles and links without problems.

Now I need to add a custom font file in the qrs resources, in order to load it from a FontLoader object in my qml code. Its size is 11'621KB.

Doing that, I can no longer compile my project. I get the following error:

Error C1060 compiler is out of heap space - qrc_qml.cpp - 745259

Of course, I tried the following link before writing this post: Microsoft Documentation - Fatal Error C1060

None of the proposed solutions worked for me. Furthermore, I cannot figure out how a simple 11MB file may cause a heap overflow on a computer equipped with 16GB of RAM, on which only a Visual Studio compiler is running.

AFAIK the issue seems to come from the Qt resources compiler, perhaps it generates a too long qrc_qml.cpp file. But if barely an 11 MB file added in the resources (which was previously empty) is enough to saturate the memory, then I am very concerned about the real possibility of using Qt for my projects. Some of them will need much, much, much more than that.

I believe (and I hope) that there is a simple solution. Can someone explain me what I should do to resolve a such issue?

trincot
  • 317,000
  • 35
  • 244
  • 286
Jean-Milost Reymond
  • 1,833
  • 1
  • 15
  • 36
  • 2
    Did you set the `/Zm` option? – drescherjm Dec 30 '19 at 17:51
  • As I said: "Of course, I tried the following link before writing this post: Microsoft Documentation - Fatal Error C1060". Conforming to that document, it was one of the first thing I tried :-) – Jean-Milost Reymond Dec 30 '19 at 19:29
  • 1
    You probably need to show the Visual Studio command line that was used when building. I have in the past used this setting to fix that error. However I have not had this with VS 2019 yet. – drescherjm Dec 30 '19 at 19:35
  • 2
    Did you try the solutions from this QT forum post? https://forum.qt.io/topic/93533/error-c1060-compiler-is-out-of-heap-space/11 – Niki Dec 31 '19 at 08:14
  • Yes I also found and read this document, it said more or less: "try to use the /Zm compiler option". However you're right, this document deserves to be read more carefully, because it was written in a Qt context, and it may contain useful information I missed. I'll do that as soon as possible. – Jean-Milost Reymond Dec 31 '19 at 13:49

1 Answers1

0

The answer in this post by Hans Passant did work for me:

Huge initialization list, how to fix "fatal error C1060: compiler is out of heap space"

The 64-bit compiler might be able to tackle it. Change the VC++ Directories > Executable Directories setting to pick either $(VC_ExecutablePath_x64_x86), x64_x64 or x64_ARM, depending on the desired platform target. Can't be much fun watching that grass grow, you are almost certainly going to change that utility to write a binary file. – Hans Passant Jul 13 '18 at 11:30

dli
  • 1