如何为Fedora安装g++ ?

时间:2021-08-16 06:52:26

How do I install g++ for Fedora Linux? I have been searching the dnf command to install g++ but didn't find anything.

如何为Fedora Linux安装g++ ?我一直在搜索dnf命令来安装g++,但是什么也没找到。

How do I install it?

如何安装?

I have already installed gcc

我已经安装了gcc。

10 个解决方案

#1


250  

The package you're looking for is confusingly named gcc-c++.

您正在寻找的包被混淆地命名为gcc-c++。

#2


119  

instead of g++ you have to write gcc-c++

而不是g+,你必须写gcc-c++

sudo dnf install gcc-c++

#3


37  

You should exec:

你应该执行:

dnf install gcc-c++

#4


8  

I had the same problem. At least I could solve it with this:

我也有同样的问题。至少我可以这样解

sudo yum install gcc gcc-c++

Hope it solves your problem too.

希望它也能解决你的问题。

#5


5  

try sudo dnf update and then sudo dnf install gcc-c++

尝试sudo dnf更新,然后sudo dnf安装gcc-c++。

#6


4  

Since Fedora 22 yum has been deprecated so the commands given in other answers will actually fire up 'Dandified yum' i.e. dnf. So the new command to install g++ in recent distributions is

自从Fedora 22 yum被弃用以来,其他答案中的命令实际上会触发“Dandified yum”,即dnf。因此,在最近的发行版中安装g++的新命令是

su -c "dnf install gcc-c++"

As of Nov 2015 this installs the 5.1.1 version.
Also note that in Fedora 23 when I gave the command g++ -v, Fedora automatically asked me if I want to install gcc-c++ package. I think thats nice.(After the install it also ran the command g++ -v for me)
Only nit pick that I can do about it is that instead of a progress indicator you just get * Downloading packages... message which you may not like if you are on a slow internet connection.

从2015年11月开始安装5.1.1版本。还请注意,在Fedora 23中,当我给出命令g+ -v时,Fedora自动地问我是否要安装gcc-c++包。我认为这是好的。(在安装之后,它也为我运行了命令g+ -v)只有nit选择我可以做的是,你得到的不是一个进度指示,而是*下载包……如果你上网很慢,你可能不喜欢的信息。

#7


1  

Just make a sample 'Hello World' Program and try to compile it using "g++ sam.cpp" in terminal, and it will ask you if you wish to download the g++ package. Press y to install.

只需创建一个示例“Hello World”程序,并尝试使用“g++ sam”编译它。cpp"在终端,它会问你是否想下载g++包。按y安装。

#8


1  

In the newer distribution you can just type command as blow

在更新的发行版中,您只需键入命令即可。

su root
dnf update
dnf install gcc-c++

#9


1  

Run the command bellow in a terminal emulator:

在终端模拟器中运行命令bellow:

sudo dnf install gcc-c++

Enter password and that's it...

输入密码,就这样……

#10


0  

It should come pre-installed if not it should be named gcc-c++

如果不是,它应该被命名为gcc-c++

#1


250  

The package you're looking for is confusingly named gcc-c++.

您正在寻找的包被混淆地命名为gcc-c++。

#2


119  

instead of g++ you have to write gcc-c++

而不是g+,你必须写gcc-c++

sudo dnf install gcc-c++

#3


37  

You should exec:

你应该执行:

dnf install gcc-c++

#4


8  

I had the same problem. At least I could solve it with this:

我也有同样的问题。至少我可以这样解

sudo yum install gcc gcc-c++

Hope it solves your problem too.

希望它也能解决你的问题。

#5


5  

try sudo dnf update and then sudo dnf install gcc-c++

尝试sudo dnf更新,然后sudo dnf安装gcc-c++。

#6


4  

Since Fedora 22 yum has been deprecated so the commands given in other answers will actually fire up 'Dandified yum' i.e. dnf. So the new command to install g++ in recent distributions is

自从Fedora 22 yum被弃用以来,其他答案中的命令实际上会触发“Dandified yum”,即dnf。因此,在最近的发行版中安装g++的新命令是

su -c "dnf install gcc-c++"

As of Nov 2015 this installs the 5.1.1 version.
Also note that in Fedora 23 when I gave the command g++ -v, Fedora automatically asked me if I want to install gcc-c++ package. I think thats nice.(After the install it also ran the command g++ -v for me)
Only nit pick that I can do about it is that instead of a progress indicator you just get * Downloading packages... message which you may not like if you are on a slow internet connection.

从2015年11月开始安装5.1.1版本。还请注意,在Fedora 23中,当我给出命令g+ -v时,Fedora自动地问我是否要安装gcc-c++包。我认为这是好的。(在安装之后,它也为我运行了命令g+ -v)只有nit选择我可以做的是,你得到的不是一个进度指示,而是*下载包……如果你上网很慢,你可能不喜欢的信息。

#7


1  

Just make a sample 'Hello World' Program and try to compile it using "g++ sam.cpp" in terminal, and it will ask you if you wish to download the g++ package. Press y to install.

只需创建一个示例“Hello World”程序,并尝试使用“g++ sam”编译它。cpp"在终端,它会问你是否想下载g++包。按y安装。

#8


1  

In the newer distribution you can just type command as blow

在更新的发行版中,您只需键入命令即可。

su root
dnf update
dnf install gcc-c++

#9


1  

Run the command bellow in a terminal emulator:

在终端模拟器中运行命令bellow:

sudo dnf install gcc-c++

Enter password and that's it...

输入密码,就这样……

#10


0  

It should come pre-installed if not it should be named gcc-c++

如果不是,它应该被命名为gcc-c++