error: C1060: compiler is out of heap space
-
I'm switching from MinGW to MSVC and found a lot of problems.
This program won't compile and C1060 error message appeared. What should I do?
-
-
@jsulm said in error: C1060: compiler is out of heap space:
@MasterBlade Take a look at https://msdn.microsoft.com/en-us/library/yz7kx3y2.aspx
I tried to add /Zm to the compiler. It will compile but nothing happens after that. No application comes out.
-
@MasterBlade said in error: C1060: compiler is out of heap space:
No application comes out
Then there should be an error
-
@jsulm said in error: C1060: compiler is out of heap space:
@MasterBlade said in error: C1060: compiler is out of heap space:
No application comes out
Then there should be an error
I didn't see any error message.
The code was alright when I use MinGW.
I have only 12 MB in the resource qrc file. I don't know why heap space is used up. I have 32GB mem.
-
@jsulm said in error: C1060: compiler is out of heap space:
@MasterBlade said in error: C1060: compiler is out of heap space:
No application comes out
Then there should be an error
OK Just to make sure I'm doing right. Is it correct to set the parameter here? I found that whatever I input here, the program compiles but nothing comes out.
-
@MasterBlade Compiler flags are set in pro file via QMAKE_CXXFLAGS
See http://doc.qt.io/qt-5/qmake-variable-reference.html -
@jsulm said in error: C1060: compiler is out of heap space:
@MasterBlade Compiler flags are set in pro file via QMAKE_CXXFLAGS
See http://doc.qt.io/qt-5/qmake-variable-reference.htmlI tried
QMAKE_CXXFLAGS += /Zmwith different Zm values from 10 to 1000. Still the same problem.
It only mentions that qrc_options.cpp has this problem. Is there anything wrong with QRC files?
-
@MasterBlade Try to split your resource file smaller ones. I already had a similar issue and I fixed it with this solution.
This last post of this thread from stackoverflow gave me the right direction:
"Qt resources are processed by resource compiler and .cpp file is generated for each .qrc file. I suppose your generated .cpp file is huge (should be more than 30MB) and VC compiler just can't compile such huge source file." -
@MasterBlade said in error: C1060: compiler is out of heap space:
It only mentions that qrc_options.cpp has this problem. Is there anything wrong with QRC files?
Use externally built resources, don't just compile 12MBs of stuff into the executable/library. You can add it as a pre-build step in creator or as an additional target in the .pro file if you wish (a bit more complicated).
-
@kshegunov said in error: C1060: compiler is out of heap space:
@MasterBlade said in error: C1060: compiler is out of heap space:
It only mentions that qrc_options.cpp has this problem. Is there anything wrong with QRC files?
Use externally built resources, don't just compile 12MBs of stuff into the executable/library. You can add it as a pre-build step in creator or as an additional target in the .pro file if you wish (a bit more complicated).
Thanks for the reply. Sorry I was busy these days.
I tried rcc command to turn the qrc file to rcc one. But the same problem happened again.
But strangely when I switch to Release mode everything went alright.
I also checked the qrc_options.cpp file it's 60.6 MB. I agree it's a little big but it's hard to believe MSVC 2017 doesn't support a file like this size. I heard it's made for big projects.
EDIT: I deleted old files and rebuilt the project. No errors this time. Thanks for the help.