fatal error C1060: compiler is out of heap space (again)
-
@Sprezzatura said in fatal error C1060: compiler is out of heap space (again):
I am using a 64-bit compiler. Compiling for 64-bit executable.
Then you will not get this error.
What does 'where cl' prints out?This post is deleted! -
Sorry I meant
where cl.exe -
Sorry I meant
where cl.exewhere cl.exe INFO: Could not find files for the given pattern(s). -
Sorry I meant
where cl.exe@Christian-Ehrlicher I've found the culprit. If I include the following in the .PRO file:
QMAKE_CFLAGS += -Zc:__cplusplus QMAKE_CFLAGS += -permissive-It compiles successfully with Qt 5.15
However, when I include this to the .PRO file:QMAKE_CFLAGS += -std:c++17 QMAKE_CFLAGS += -Zc:__cplusplus QMAKE_CFLAGS += -permissive-even Qt 5.15 fails with the "Out of Heap Space" error.
If I remove this line and try to compile with Qt 6.9, I get:QMAKE_CFLAGS += -std:c++17"Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler"Why would this option cause the Out of Heap Space error? Are there other options I need to add?
-
You have to call it in the console where you build you Qt... you are using a 32bit compiler.
λ where cl C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\cl.exe -
You have to call it in the console where you build you Qt... you are using a 32bit compiler.
λ where cl C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\cl.exe@Christian-Ehrlicher
[1] Here's what is displayed in the Compile Output window when I delete the "-nologo" option:Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34810 for x64 Copyright (C) Microsoft Corporation. All rights reserved.Note the "x64".
[2] My .PRO file contains:
contains(QT_ARCH, i386) { message("32-bit" $$QT_ARCH $$QT_VERSION) } contains(QT_ARCH, x86_64) { message("64-bit" $$QT_ARCH $$QT_VERSION) }This is displayed in the Compile Output window:
Project MESSAGE: 64-bit x86_64 6.9.0[3] I tried creating a new Kit and adding a 32-bit compiler. Qt flat out rejected it.
[4] What does the "λ" lambda mean in your example?
When you say "the console where you build your Qt", do you mean the Terminal window in Qt Creator?
When I do that, I get:>where cl INFO: Could not find files for the given pattern(s).I'm using Windows.
-
@Christian-Ehrlicher
[1] Here's what is displayed in the Compile Output window when I delete the "-nologo" option:Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34810 for x64 Copyright (C) Microsoft Corporation. All rights reserved.Note the "x64".
[2] My .PRO file contains:
contains(QT_ARCH, i386) { message("32-bit" $$QT_ARCH $$QT_VERSION) } contains(QT_ARCH, x86_64) { message("64-bit" $$QT_ARCH $$QT_VERSION) }This is displayed in the Compile Output window:
Project MESSAGE: 64-bit x86_64 6.9.0[3] I tried creating a new Kit and adding a 32-bit compiler. Qt flat out rejected it.
[4] What does the "λ" lambda mean in your example?
When you say "the console where you build your Qt", do you mean the Terminal window in Qt Creator?
When I do that, I get:>where cl INFO: Could not find files for the given pattern(s).I'm using Windows.
@Sprezzatura said in fatal error C1060: compiler is out of heap space (again):
where cl
INFO: Could not find files for the given pattern(s).Again: execute this on the command line where you also compiled your Qt. Execatly where you did 'cl -nologo'
You are using a 32bit compiler which creates 64 bit executables. Or you have very low ram on your system which I doubt. -
In my VS2002 installation there are 4 different cl.exe versions:
c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx86\x86\cl.exe
c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx86\x64\cl.exe
c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x86\cl.exe
c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.exeTwo of them (the ..\Hostx86\x64\cl.exe and the ..\Hostx64\x64\cl.exe will show the same output:
"Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34810 for x64" and both will compile and build 64 bit ..exe files for Qt6.So you have a 50% chance of running the correct compiler, i.e. the cl.exe in the subdirectory ..\Hostx64\x64
-
@Sprezzatura said in fatal error C1060: compiler is out of heap space (again):
where cl
INFO: Could not find files for the given pattern(s).Again: execute this on the command line where you also compiled your Qt. Execatly where you did 'cl -nologo'
You are using a 32bit compiler which creates 64 bit executables. Or you have very low ram on your system which I doubt.@Christian-Ehrlicher I'm not launching this from the command line. I'm using Qt Creator, which automatically creates a stream of commands, including launching cl.exe, followed by a ton of parameters.
The output appears in the "Compile Output" window of the Qt Creator IDE. -
@Sprezzatura said in fatal error C1060: compiler is out of heap space (again):
where cl
INFO: Could not find files for the given pattern(s).Again: execute this on the command line where you also compiled your Qt. Execatly where you did 'cl -nologo'
You are using a 32bit compiler which creates 64 bit executables. Or you have very low ram on your system which I doubt.Good news! It's working!
The solution was to upgrade from VS 2022 ver. 17.13, to ver. 17.14.
I tried getting VS to update itself, but it locked up and wiped itself. I had to download and re-install VS 17.14.Here's the kicker: I got the suggestion from OpenAI/ChatGPT!
I'm an AI skeptic, but I have to give credit where it's due.
Also, ChatGPT suggested "-bigobj", but that didn't make a difference.
A sincere thanks to Christian and hskoglund from a 77-year old, half-blind hack :o)
-
S Sprezzatura has marked this topic as solved
-
Just as an aside (since I'm a little late to the party): You should turn on C++17 in the .pro file with the line
CONFIG += c++17 -
Just as an aside (since I'm a little late to the party): You should turn on C++17 in the .pro file with the line
CONFIG += c++17@SimonSchroeder I do have that included:
versionAtLeast(QT_VERSION, 6.0.0) { CONFIG += c++17 # Fails with Qt 5.13 QMAKE_CFLAGS += -std:c++17 # required for Qt 6 }