• 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

  • 相关阅读:
    fms服务器端呼叫客户端
    Linux C取整的方法
    fms客户端呼叫服务器端
    Tree Control DataProviders
    IE7下的css style display的兼容处理
    Maxthon,TheWorld,MyIE等多标签浏览器的Flash缓存问题
    Android深入浅出系列之实例应用—弹出消息Toast对象的使用纯文本方式(一)
    C#温故而知新学习系列之XML编程—Xml读取器XmlReader类(二)
    一步一个脚印学习WCF系列之WCF概要—生成元数据与代理(五)
    Eclipse 常用快捷键(转)
  • 原文地址:https://www.cnblogs.com/wuxie1989/p/5853713.html
Copyright © 2020-2023  润新知