This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
I had problem about the gcc version
- From: Chen tom <tomcp85 at hotmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Fri, 29 Sep 2017 07:46:07 +0000
- Subject: I had problem about the gcc version
- Authentication-results: sourceware.org; auth=none
- Authentication-results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=hotmail.com;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
hello ,
20 days ago, I had tried to install the gcc-master.zip packet, but failed, so I deleted the file I have installed, carelessly . two days ago I have the gcc-7 installed, there is a problem as followed:
tom@tom-Inspiron-7447:~$ gcc -o test test.c
gcc: error trying to exec 'cc1': execvp: No such file or directory
tom@tom-Inspiron-7447:~$ gcc-7 -o test test.c
tom@tom-Inspiron-7447:~$ ./test
Hello world!
so I want to completely delete the documents installed, "version 8.0.0", and set gcc to version 7, I have done some orders as follow
tom@tom-Inspiron-7447:/usr/local/bin$ sudo update-alternatives --remove-all gcc
tom@tom-Inspiron-7447:/usr/local/bin$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70
update-alternatives: using /usr/bin/gcc-7 to provide /usr/bin/gcc (gcc) in auto mode
tom@tom-Inspiron-7447:/usr/local/bin$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-pc-linux-gnu
Configured with: ./configure
Thread model: posix
gcc version 8.0.0 20170912 (experimental) (GCC)
tom@tom-Inspiron-7447:/usr/local/bin$ sudo update-alternatives --config gcc
There is only one alternative in link group gcc (providing /usr/bin/gcc): /usr/bin/gcc-7
Nothing to configure.
tom@tom-Inspiron-7447:/usr/local/bin$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-pc-linux-gnu
Configured with: ./configure
Thread model: posix
gcc version 8.0.0 20170912 (experimental) (GCC)
The orders did not work, I don't know how to do it ,would you give me any advice.