NPCHK Blog

路邊小博客(<ゝω・)☆

解決軟件編譯時出現"g++: internal compiler error: Killed"

問題

曾在DigitalOcean 512M VPS編譯Aria2時遇到下列的報錯:

{standard input}: Assembler messages:
{standard input}:1907: 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 file:///usr/share/doc/gcc-4.9/README.Bugs for instructions.
Makefile:2291: recipe for target 'OptionHandlerFactory.lo' failed

解決方法

其後發現引起錯誤的原因是512MB Ram,需要更多的Ram以進行編譯

增加2G Swap即可解決問題

fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
swapon -s   #檢查Swap是否生效






發佈留言

發佈留言必須填寫的電子郵件地址不會公開。

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料