Qt工作笔记- 解决cc1plus.exe: error: out of memory allocating

原文地址如下:

https://blog.csdn.net/liukang325/article/details/53159446

QT中增加资源文件过大时,会编译不过,报错:

cc1plus.exe: out of memory allocating 1073745919 bytes
  •  

使用qrc资源文件,也就是在QT的工程中添加资源文件,就是添加的资源文件(如qrc.cpp)会直接被存放到静态数组中,从而一直占用内存,使内存的利用率不高。有的时候如果资源过大,可能编译都无法通过,会造成out of memory的错误。

解决方法: 
在工程PRO文件中,添加:

CONFIG += resources_big
  • 1

猜你喜欢

转载自blog.csdn.net/qq78442761/article/details/81486701