Qt编译错误:“分配134 MB的内存不足"“找不到cc1plus.exe"; [英] Qt compiling error: "out of memory allocating 134 MB" "cc1plus.exe not found"

查看:67
本文介绍了Qt编译错误:“分配134 MB的内存不足"“找不到cc1plus.exe";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Windows游戏,该游戏需要很多小小的不同的图像,我将它们放在resources.qrc中,这些图像都是可以的.14 MB.

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.

当我尝试编译时,唯一的错误是:内存不足,分配了134 MB"找不到cc1plus.exe".

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

我该如何处理?

推荐答案

不要将它们放在qrc中,将它们保留为单独的资源(或每个图像都使用新的qrc文件),而只需将其加载到应用程序中即可启动.Qt会生成一个qrc_XXXXX.cpp文件,在该文件中,该文件将所有资源的char数组形式的二进制数据有效地插入该文件的资源文件XXXXX中(是,对于您的14MB图像,一个数组,即:14680064字节(写为十六进制(0xXX)个字节放入1个文件...这将很大!),很可能是糟糕的编译器只是咳嗽了它们...

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

这篇关于Qt编译错误:“分配134 MB的内存不足"“找不到cc1plus.exe";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆