I wanted to compile printf("Hello World!\r\n");
on my Nexus and installed sudo apt-get install gcc
but if I compile using
gcc -x c++ helloworld.cpp -lstdc++ -o helloworld
I get the error
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
It once did run but after reinstalling ubuntu it only shows missing cc1plus error and as I am no specialist (just wanted to run something like
system("service ssh stop");
or so) I want to ask what I can to to repair the gcc.
gcc -x c++ helloworld.cpp -lstdc++ -o helloworld
but I will not change that as it worked once.gcc
to treat the file as a C++ source file - in which case you will need to installg++
as well as plaingcc
(the giveaway isexec 'cc1plus'
)sudo apt-get install g++
I get the errorE: You don't have enough free space in /var/cache/apt/archives/.
where I triedsudo apt-get clean
andsudo apt-get autoclean
and evensudo apt autoremove
what did not help.gcc
then the simplest thing would be to not try to compile it asg++
(since it appears to be plain 'C' syntax) i.e. either rename your source code file tohello.c
or usegcc -x c
- "I will not change that as it worked once" is not really a good argument here, IMHO.