Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt compiling error: "out of memory allocating 134 MB" "cc1plus.exe not found"

Tags:

c++

qt

I'm developing a Windows game that needs a lot of small different images, that I put in resources.qrc, they are in tot. 14 MB.

When I try to compile the only error is: "out of memory allocating 134 MB" "cc1plus.exe not found".

How can I handle this?

like image 233
Francesco Bonizzi Avatar asked Sep 01 '12 20:09

Francesco Bonizzi


2 Answers

Windows 7SP1 x86 4 GB RAM

Qt 5.7.0

I had the same problem, when I added big file in resources in Qt. I had the error:

cc1plus.exe:-1: error: out of memory allocating 1073745919 bytes

Solution:

Add CONFIG += resources_big into the *.pro file.

I took it here: cc1plus.exe: out of memory | 60MB encrypted resource file

like image 123
Владимир Avatar answered Sep 28 '22 01:09

Владимир


Don't put them in the qrc, keep them as individual resources (or a new qrc file for each of the image), and just load them on application startup. Qt generates a qrc_XXXXX.cpp file where it effectively inserts the binary data in form of char array of ALL your resources in the resource fileXXXXX in this file (yes, ONE array for your images of 14MB, ie: 14680064 bytes (written as hex (0xXX) bytes into 1 file... it will be big!), highly possibly poor compiler just coughs on them...

like image 44
Ferenc Deak Avatar answered Sep 28 '22 01:09

Ferenc Deak