[problem solving] C + +: fatal error: killed signal terminated program cc1plus
1. Problem description
During C + + compilation in Linux system, the following errors occur, resulting in compilation abort:
C++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
2. Solution – swap partition
After consulting the relevant information, it is considered that the virtual machine is caused by insufficient memory. This problem is solved by creating swap partition, and the compilation is successful
the following is a summary of the creation and activation of swap partitions:
# Create the partition path
sudo mkdir -p /var/cache/swap/
# Set the size of the partition
# bs=64M is the block size, count=64 is the number of blocks, so the swap space size is bs*count=4096MB=4GB
sudo dd if=/dev/zero of=/var/cache/swap/swap0 bs=64M count=64
# Set permissions for this directory
sudo chmod 0600 /var/cache/swap/swap0
# Create the SWAP file
sudo mkswap /var/cache/swap/swap0
# Activate the SWAP file
sudo swapon /var/cache/swap/swap0
# Check if SWAP information is correct
sudo swapon -s
The effect diagram of partition creation and activation is as follows:
The path of the swap 0 file is under/var/cache/swap/. After compilation, if you don’t want to swap partitions, you can delete it.
Command to delete swap partition:
sudo swapoff /var/cache/swap/swap0
sudo rm /var/cache/swap/swap0
Free space command:
sudo swapoff -a
#Detailed usage: swapoff --help
#View current memory usage: --swapoff: free -m
Read More:
- [Solved] c++: fatal error: Killed signal terminated program cc1plus
- Vmware Virtual Machine ubuntu Compile Error: fatal error: Killed signal terminated program cc1plus
- Make update-api Error: ckati failed with: signal: killed
- [Solved] dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
- [Solved] gnutls_handshake() failed: The TLS connection was non-properly terminated
- [Solved] error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.
- [Solved] gcc: error trying to exec ‘cc1‘: execvp: No such file or directory
- [Solved] xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory #include <expat.h>
- Sublime text 3 compiles and executes C/C++ programs directly
- [Solved] Ubuntu Eclipse C/C++ Error: launch failed.binary not found
- [Solved] Linux C++ warning: ISO C++ forbids converting a string constant to ‘char*‘ [-Wwrite-strings]
- How to Solve Docker delete container image error: Error response from daemon: conflict: unable to delete 7cc1942f1ed5 (must be forced)
- MAC: Clion configure C compiler Error: The C compiler identification is unknown
- [Solved] Fatal error: GLOG/logging. H: there is no such file or directory
- Vector series in actual C + +_ To_ fit()
- [Solved] fatal error: openssl/hmac.h: No such file or directory
- [Solved] Ubuntu Compile Rust Program Error: failed to run custom build command for openssl-sys v0.9.39
- [Solved] Linux program error: dpkg is interrupted. You must manually run ‘sudo dpkg — configure – a’
- [Solved] fatal error: jemalloc/jemalloc.h: No such file or directory
- error: stray ‘\343’ in program [How to Solve]