zoukankan      html  css  js  c++  java
  • gcc编译出错---make[5]: *** [s-attrtab] Killed

    内存不足导致的编译出错,解决方法是增加swapfile。

    root@ubuntu:home# swapon -s

    Filename    Type            Size    Used    Priority

    创建swapfile大小512M;

    root@ubuntu:home# dd if=/dev/zero of=/swapfile bs=1024 count=512k

    524288+0 records in

    524288+0 records out

    536870912 bytes (537 MB) copied, 8.54637 s, 62.8 MB/s

    应用&设置;

    root@ubuntu:/# mkswap /swapfile 

    Setting up swapspace version 1, size = 524284 KiB

    no label, UUID=f4719d4d-1d1f-49c9-b34e-b2af28e6374e

    root@ubuntu:/# swapon /swapfile 

    添加到开机启动项:

    root@ubuntu:/# vim /etc/fstab

    "/etc/fstab" 13L, 756C

    # /etc/fstab: static file system information.

    #

    # Use 'blkid' to print the universally unique identifier for a

    # device; this may be used with UUID= as a more robust way to name devices

    # that works even if disks are added and removed. See fstab(5).

    #

    # <file system> <mount point>   <type>  <options>       <dump>  <pass>

    # / was on /dev/sda1 during installation

    UUID=3fea2e6f-860e-40c6-8a43-296130837358 /    ext4    errors=remount-ro 0       1

    # swap was on /dev/sda5 during installation

    UUID=d1d5044f-57be-4eeb-a577-3e3bc99591a5 none     swap    sw   0       0

    /dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0

    /dev/sda2       /root/sda2       ext4    rw      0      1

    /swapfile       none     swap    default       0              0 

    ~                                                                       

    "/etc/fstab" 14L, 837C written

    root@ubuntu:home# swapon -s

    Filename      Type    Size    Used    Priority

    /swapfile     file  524284  8468    -1                                                                          

    root@ubuntu:/# free

                 total       used       free     shared    buffers     cached

    Mem:        506756     499228       7528       1104       2548     395148

    -/+ buffers/cache:     101532     405224

    Swap:       524284          0     524284

    重新编译,即可顺利编译完成gcc

  • 相关阅读:
    SQLAlchemy使用merge
    Flask 处理文件 file
    PostgreSQL 常用命令
    Elasticsearch 常用命令
    Python3 encode中的unicode-escape和raw_unicode_escape
    Python 字符串16进制转换为字符串
    利用 Redis 实现接口频次限制
    Flask-Limiter 接口访问频次限制
    博客内容管理(2)-「解决方案」分类的内容设定和编写位置
    踩坑 | u盘 | u盘插入电脑无法识别打开
  • 原文地址:https://www.cnblogs.com/wuxie1989/p/5853713.html
Copyright © 2011-2022 走看看