Francesco B. Francesco B. - 3 days ago 5
C++ Question

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

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

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

How can I handle this?
Thank you very much.

Answer

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

Comments