代码改变世界

Linux make: g++: Command not found

  潇湘隐者  阅读(22894)  评论(0编辑  收藏  举报

Linux使用make命令时遇到“make: g++: Command not found”,这个主要是没有安装gcc-c++.x86_64,如下所示

 
[root@localhost nethogs]# make
g++ -g -Wall -Wextra -c packet.cpp
make: g++: Command not found
make: *** [packet.o] Error 127

 

root@localhost nethogs]# yum search "gcc-c++"
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
==================================== N/S Matched: gcc-c++ ====================================
gcc-c++.x86_64 : C++ support for GCC
 
  Name and summary matches only, use "search all" for everything.
[root@localhost nethogs]# yum list "gcc-c++"
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
media                                                                  | 4.1 kB     00:00 ... 
Available Packages
gcc-c++.x86_64                               4.4.7-11.el6                                media

 

[root@localhost nethogs]# yum install "gcc-c++.x86_64"
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.4.7-11.el6 will be installed
--> Processing Dependency: gcc = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.x86_64
--> Processing Dependency: libstdc++-devel = 4.4.7-11.el6 for package: gcc-c++-4.4.7-11.el6.x86_64
--> Processing Dependency: libmpfr.so.1()(64bit) for package: gcc-c++-4.4.7-11.el6.x86_64
--> Running transaction check
---> Package gcc.x86_64 0:4.4.7-11.el6 will be installed
--> Processing Dependency: cpp = 4.4.7-11.el6 for package: gcc-4.4.7-11.el6.x86_64
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-11.el6.x86_64
---> Package libstdc++-devel.x86_64 0:4.4.7-11.el6 will be installed
---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed
--> Running transaction check
---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed
--> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
--> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
---> Package cpp.x86_64 0:4.4.7-11.el6 will be installed
--> Running transaction check
---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
==============================================================================================
 Package                   Arch             Version                     Repository       Size
==============================================================================================
Installing:
 gcc-c++                   x86_64           4.4.7-11.el6                media           4.7 M
Installing for dependencies:
 cloog-ppl                 x86_64           0.15.7-1.2.el6              media            93 k
 cpp                       x86_64           4.4.7-11.el6                media           3.7 M
 gcc                       x86_64           4.4.7-11.el6                media            10 M
 libstdc++-devel           x86_64           4.4.7-11.el6                media           1.6 M
 mpfr                      x86_64           2.4.1-6.el6                 media           156 k
 ppl                       x86_64           0.10.2-11.el6               media           1.3 M
 
Transaction Summary
==============================================================================================
Install       7 Package(s)
 
Total download size: 22 M
Installed size: 53 M
Is this ok [y/N]: y  
Downloading Packages:
----------------------------------------------------------------------------------------------
Total                                                         163 MB/s |  22 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : mpfr-2.4.1-6.el6.x86_64                                                    1/7 
  Installing : cpp-4.4.7-11.el6.x86_64                                                    2/7 
  Installing : ppl-0.10.2-11.el6.x86_64                                                   3/7 
  Installing : cloog-ppl-0.15.7-1.2.el6.x86_64                                            4/7 
  Installing : gcc-4.4.7-11.el6.x86_64                                                    5/7 
  Installing : libstdc++-devel-4.4.7-11.el6.x86_64                                        6/7 
  Installing : gcc-c++-4.4.7-11.el6.x86_64                                                7/7 
  Verifying  : gcc-4.4.7-11.el6.x86_64                                                    1/7 
  Verifying  : gcc-c++-4.4.7-11.el6.x86_64                                                2/7 
  Verifying  : mpfr-2.4.1-6.el6.x86_64                                                    3/7 
  Verifying  : libstdc++-devel-4.4.7-11.el6.x86_64                                        4/7 
  Verifying  : cpp-4.4.7-11.el6.x86_64                                                    5/7 
  Verifying  : ppl-0.10.2-11.el6.x86_64                                                   6/7 
  Verifying  : cloog-ppl-0.15.7-1.2.el6.x86_64                                            7/7 
 
Installed:
  gcc-c++.x86_64 0:4.4.7-11.el6                                                               
 
Dependency Installed:
  cloog-ppl.x86_64 0:0.15.7-1.2.el6     cpp.x86_64 0:4.4.7-11.el6 gcc.x86_64 0:4.4.7-11.el6 
  libstdc++-devel.x86_64 0:4.4.7-11.el6 mpfr.x86_64 0:2.4.1-6.el6 ppl.x86_64 0:0.10.2-11.el6
 
Complete!
编辑推荐:
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· DeepSeek 解答了困扰我五年的技术问题
阅读排行:
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
历史上的今天:
2013-08-21 Nagios学习实践系列——产品介绍篇
2013-08-21 Windows Server 2008 下ASP程序连接ORACLE数据库驱动错误
2010-08-21 SQL模板资源管理器,你用了吗?
点击右上角即可分享
微信分享提示