cpp项目编译时报错: c++: internal compiler error: Killed

c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
gmake[2]: *** [CMakeFiles/tdcore.dir/td/telegram/MessagesManager.cpp.o] Error 4
gmake[1]: *** [CMakeFiles/tdcore.dir/all] Error 2
gmake: *** [all] Error 2

原因是内存不够,并且没swap,增加swap

[root@iZrj931hn8rgs8397tuz5mZ build]# dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 2.34565 s, 447 MB/s
[root@iZrj931hn8rgs8397tuz5mZ build]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3790         101        2546           0        1142        3454
Swap:             0           0           0
[root@iZrj931hn8rgs8397tuz5mZ build]# mkswap /var/swap.img
Setting up swapspace version 1, size = 1023996 KiB
no label, UUID=99a90e95-ee16-45f7-801d-71378b1a7551
[root@iZrj931hn8rgs8397tuz5mZ build]# swapon /var/swap.img

猜你喜欢

转载自blog.51cto.com/zhangxiaohe/2130996