我刚刚从源代码安装了gcc-8.1,使用以下步骤:
wget https://ftp.gnu.org/gnu/gcc/gcc-8.1.0/gcc-8.1.0.tar.gz
tar xvf gcc-8.1.0.tar.gz
cd gcc-8.1.0
apt build-dep gcc
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-8.1.0/configure --prefix=/usr/bin/gcc-8.1 --enable-languages=c,c++,fortran,go --disable-multilib
make -j8
make install一切都是正确的?
然后我将它添加到更新选项中。
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8.1 60 --slave /usr/bin/g++ g++ /usr/bin/g++-8.1
There are 3 choices for the alternative gcc (providing /usr/bin/gcc).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/gcc-7 60 auto mode
1 /usr/bin/gcc-5 60 manual mode
* 2 /usr/bin/gcc-7 60 manual mode
3 /usr/bin/gcc-8.1 60 manual mode
Press <enter> to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/bin/gcc-8.1 to provide /usr/bin/gcc (gcc) in manual mode
update-alternatives: warning: skip creation of /usr/bin/g++ because associated file /usr/bin/g++-8.1 (of link group gcc) doesn't exist我的问题是当我输入gcc -v时,上面写着bash: /usr/bin/gcc: Is a directory
发布于 2022-06-29 20:41:48
这是一把双刃剑。我在windows上,所以没有linux术语。但我的gcc问题在很大程度上被发现了。但也许这会帮助一个人从几个小时的挖掘和尝试这个和那个。但不能说我在这个过程中没有学到很多东西。
这至少让我来到了这里
https://stackoverflow.com/questions/50315730
复制相似问题