编译出错c++: internal compiler error: Killed (program cc1plus)

源码编译
917
linux
linux 举报
2020-05-21

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

Please submit a full bug report,

查了很多资料,最后发现主要原因是内存不足, 临时使用交换分区来解决吧

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



================


最近在使用github上的一个模拟器,需要自己对其中文件进行make编译。但是中间遇到了不知道多少个错误,吐血。想了想还是记录一下,

错误

compiling moc/moc_qwt_plot_panner.cpp

compiling moc/moc_qwt_plot_picker.cpp

compiling moc/moc_qwt_plot_zoomer.cpp

compiling moc/moc_qwt_slider.cpp

compiling moc/moc_qwt_scale_widget.cpp

{standard input}: Assembler messages:

{standard input}:4145: Warning: end of file in string; '"' inserted

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

Please submit a full bug report,

with preprocessed source if appropriate.

See  for instructions.

Makefile:139809: recipe for target 'obj/qrc_qgcresources.o' failed

make[1]: *** [obj/qrc_qgcresources.o] Error 4

make[1]: *** Waiting for unfinished jobs....

make[1]: Leaving directory '/home/emma/ub-anc/build-emulator/qgc_gui'

Makefile:43: recipe for target 'sub-qgc_gui-make_first-ordered' failed

make: *** [sub-qgc_gui-make_first-ordered] Error 2

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

解决方法

google了各种办法,发现应该是内存不够,ubuntu的make命令好像比较吃内存。

    尝试用swap

    check系统中swap的配置

    查看多少可用的swap以及memory

$ sudo swapon --show

$ free -h

    1

    2

在这里插入图片描述

    check 可用的磁盘空间

$ df -h

    1

/dev/sda1是磁盘空间

    创建一个2G的swap file

$ sudo fallocate -l 2G /swapfile 

    1

    验证创建的swapfile是否正确

$ ls lh /swapfile

    1

    修改文件权限,只能被root访问

$ sudo chmod 600 /swapfile

$ ls lh /swapfile

    1

    2

    标记该文件空间为swap space

$ sudo mkswap /swapfile

    1

详情见下图:

在这里插入图片描述

到这里,然后再重新执行qmake与make命令,就成功啦。

————————————————

版权声明:本文为CSDN博主「马大树啊」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/sinat_31220673/java/article/details/95351169


倒序看帖 只看楼主
热点关注
postfix中的main.cf 中的一些部分详细说明
在后台用进程名运行bash脚本
shell脚本每行后面多了一个^M的原因和解决办法
定时检测服务,检测down掉后重启。系统检测到DMSERVER运行正常
挂载磁盘的时候遇到一个问题,挂载完磁盘之后重启服务器挂载的盘丢失了.
中标麒麟系统Your trial is EXPIRED and no VALID licens
termux 开启ssh并用用户名和密码登陆
组成共享库的目标文件和一般的目标文件有所不同,在编译时要加-fPIC和-share选项,例如:
gcc指定链接库路径后还是找不到库文件
./configure -build,-host,-target设置
关于Linux系统中configure中build,target,host中的若干问题
不用单独编译gmp、mpfr和mpc三个包,放在gcc源码下面一起编译
shell参数判断
服务停止、启动、重启一体化脚本,万能语言启动脚本
postfix下过滤垃圾邮件的有效方法