现象描述:在树莓派上用qt编译二维码显示相关的UI程序时,经常报以上错误,有时候断电重启首次编译不会报错(估计是刚上电系统占用的内存比较少)

g++: internal compiler error: Killed (program cc1plus)

原因是系统内存不足,没有交换分区, 编译过程中内存耗尽, 导致了编译中断 …
解决方式也很简单, 就是(临时)增加一个交换分区:

sudo dd if=/dev/zero of=/swapfile bs=64M count=16
sudo mkswap /swapfile
sudo swapon /swapfile

After compiling, you may wish to

Code:

sudo swapoff /swapfile
sudo rm /swapfile
 

1. 创建分区文件, 大小 2G

dd if=/dev/zero of=/swapfile bs=1k count=2048000

2. 生成 swap 文件系统

mkswap /swapfile

3. 激活 swap 文件

swapon /swapfile

这样就木有问题了, 但是这样并不能在系统重启的时候自动挂载交换分区, 这样我们就需要修改 fstab.
修改 /etc/fstab 文件, 新增如下内容:

/swapfile  swap  swap    defaults 0 0

这样每次重启系统的时候就会自动加载 swap 文件了.

备注:1. 创建的交换分区大小为: bs x count。

2. Swap 空间的作用可简单描述为:当系统的物理内存不够用的时候,就需要将物理内存中的一部分空间释放出来,以供当前运行的程序使用。那些被释放的空间可能来自一 些很长时间没有什么操作的程序,这些被释放的空间被临时保存到Swap空间(磁盘空间虚拟成内存使用)中,等到那些程序要运行时,再从Swap中恢复保存 的数据到内存中。

解决: g++: internal compiler error: Killed (program cc1plus)的更多相关文章

  1. p4factory 解决“g++: internal compiler error: Killed (program cc1plus)” make error问题

    参考:解决: g++: internal compiler error: Killed (program cc1plus) 在安装p4factory的时候,执行: ./install_deps.sh ...

  2. Mysql 编译报错 g++: internal compiler error: Killed (program cc1plus) 解决办法

    g++: internal compiler error: Killed (program cc1plus) 解决办法 g++: internal compiler error: Killed (pr ...

  3. 编译openwrt时报错:g++: internal compiler error: Killed (program cc1plus)

    答: 这是内存不足导致的,增大内存或者减少运行的线程即可

  4. caffe-ssd编译runtest时候报错:g++: internal compiler error: Killed (program cc1plus)

    大哥,你的内存不够了,删点儿东西吧

  5. 给阿里云主机添加swap分区,解决问题:c++: internal compiler error: Killed (program cc1plus)

    前言 今天安装spdlog,一个快速得C++日志库,按照文档步骤,不料出现了一堆错误,像c++: internal compiler error: Killed (program cc1plus)等一 ...

  6. c++: internal compiler error: Killed (program cc1plus)

    转自https://blog.csdn.net/qq_27148893/article/details/88936044 这是在开发板上编译opencv的时候报了一个错,主要是在编译过程中,内存不够造 ...

  7. 安装lxml时gcc: internal compiler error: Killed (program cc1)的解决方法

    在安装lxml时出现如下错误 gcc: internal compiler error: Killed (program cc1) 通过查看dmesg发现下述错误信息[2517343.500178] ...

  8. 阿里云linux服务器安装Phalcon-----"phalcon Volt directory can't be written" "gcc: internal compiler error: Killed (program cc1)"

    这里特别蛋疼的一件事是官方英文文档和中文文档命令参数略有不同 中文文档: //通用平台下安装指定的软件包: sudo yum install git gcc make pcre-devel php-d ...

  9. gcc 编译出现 internal compiler error: Killed

    系统没有交换分区, 编译过程中内存耗尽, 导致了编译中断 …解决方式也很简单, 就是增加一个交换分区:       创建分区文件, 大小 2G dd if=/dev/zero of=/swapfile ...

随机推荐

  1. CQRS之旅——旅程3(订单和注册限界上下文)

    旅程3:订单和注册限界上下文 CQRS之旅的第一站 "寓言家和鳄鱼是一样的,只是名字不同" --约翰·劳森 描述: 订单和注册上下文有一部分职责在会议预订的过程中,在此上下文中,一 ...

  2. HDU 5739 Fantasia 双连通分量 树形DP

    题意: 给出一个无向图,每个顶点有一个权值\(w\),一个连通分量的权值为各个顶点的权值的乘积,一个图的权值为所有连通分量权值之和. 设删除顶点\(i\)后的图\(G_i\)的权值为\(z_i\),求 ...

  3. 不同storyboard间跳转

    小项目中用到storyboard,可以按照模块来新建多个sb. 以下是代码实现跳转实现: UIStoryboard *anSb=[UIStoryboard storyboardWithName:@&q ...

  4. 【Jump Game II 】cpp

    题目: Given an array of non-negative integers, you are initially positioned at the first index of the ...

  5. Marketing learning-2

    Part three 1.strategies for leadership 1)operational excellence:operational competence 2)performance ...

  6. cegui 编译过程详解(cegui-0.8.2)

    cegui配置整了好长时间了,在一位大牛帮助下终于搞定了,网上的教程大多是老版本的,cegui-0.8.2版的配置寥寥无几,现在总结一下,献给正在纠结的小白们. 准备工作 第一步,先下载cegui-0 ...

  7. Python 3.6 性能测试框架Locust安装及使用

    背景 Python3.6 性能测试框架Locust的搭建与使用 基础 python版本:python3.6 开发工具:pycharm Locust的安装与配置 点击“File”→“setting” 点 ...

  8. Flask-WebSocket案例

    实验1:实现初始的通信 客户端:用浏览器向服务端发送信息 服务端:首先接收浏览器发来的信息,并作出相应应答 第一步:需要导入模块: from flask import Flask,request fr ...

  9. Linux互斥锁、条件变量和信号量

    Linux互斥锁.条件变量和信号量  来自http://kongweile.iteye.com/blog/1155490 http://www.cnblogs.com/qingxia/archive/ ...

  10. springboot添加事务

    (转自:http://www.cnblogs.com/xingzc/p/6029483.html) 什么是事务? 我们在开发企业应用时,对于业务人员的一个操作实际是对数据读写的多步操作的结合.由于数据 ...