解决出现“ gmake: g++: Command not found gmake: *** [project.o] Error 127”的问题

时间:2021-10-15 00:18:00

1、在编译qt-everywhere-opensource-src-4.8.5时,出现如下问题

gmake: g++: Command not found
gmake: *** [project.o] Error 127
make: *** No targets specified and no makefile found. Stop.

2、查找错误原因,使用指令yum search “gcc-c++”

[root@localhost arm-qte-4.8.5]# yum search "gcc-c++"
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
============================= N/S Matched: gcc-c++ =============================
gcc-c++.i686 : C++ support for GCC
Name and summary matches only, use "search all" for everything.

3、使用指令yum install “gcc-c++.i686” 安装对应的文件

[root@localhost arm-qte-4.8.5]# yum install "gcc-c++.i686"
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.i686 0:4.4.7-17.el6 will be installed
--> Processing Dependency: libstdc++-devel = 4.4.7-17.el6 for package: gcc-c++-4.4.7-17.el6.i686
--> Processing Dependency: libstdc++ = 4.4.7-17.el6 for package: gcc-c++-4.4.7-17.el6.i686
--> Processing Dependency: gcc = 4.4.7-17.el6 for package: gcc-c++-4.4.7-17.el6.i686
--> Running transaction check
---> Package gcc.i686 0:4.4.7-4.el6 will be updated
---> Package gcc.i686 0:4.4.7-17.el6 will be an update
--> Processing Dependency: libgomp = 4.4.7-17.el6 for package: gcc-4.4.7-17.el6.i686
--> Processing Dependency: cpp = 4.4.7-17.el6 for package: gcc-4.4.7-17.el6.i686
--> Processing Dependency: libgcc >= 4.4.7-17.el6 for package: gcc-4.4.7-17.el6.i686
---> Package libstdc++.i686 0:4.4.7-4.el6 will be updated
---> Package libstdc++.i686 0:4.4.7-17.el6 will be an update
---> Package libstdc++-devel.i686 0:4.4.7-17.el6 will be installed
--> Running transaction check
---> Package cpp.i686 0:4.4.7-4.el6 will be updated
---> Package cpp.i686 0:4.4.7-17.el6 will be an update
---> Package libgcc.i686 0:4.4.7-4.el6 will be updated
---> Package libgcc.i686 0:4.4.7-17.el6 will be an update
---> Package libgomp.i686 0:4.4.7-4.el6 will be updated
---> Package libgomp.i686 0:4.4.7-17.el6 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
gcc-c++ i686 4.4.7-17.el6 base 4.3 M
Installing for dependencies:
libstdc++-devel i686 4.4.7-17.el6 base 1.6 M
Updating for dependencies:
cpp i686 4.4.7-17.el6 base 3.4 M
gcc i686 4.4.7-17.el6 base 8.2 M
libgcc i686 4.4.7-17.el6 base 114 k
libgomp i686 4.4.7-17.el6 base 136 k
libstdc++ i686 4.4.7-17.el6 base 302 k

Transaction Summary
================================================================================
Install 2 Package(s)
Upgrade 5 Package(s)

Total download size: 18 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): cpp-4.4.7-17.el6.i686.rpm | 3.4 MB 00:00
(2/7): gcc-4.4.7-17.el6.i686.rpm | 8.2 MB 00:02
(3/7): gcc-c++-4.4.7-17.el6.i686.rpm | 4.3 MB 00:01
(4/7): libgcc-4.4.7-17.el6.i686.rpm | 114 kB 00:00
(5/7): libgomp-4.4.7-17.el6.i686.rpm | 136 kB 00:00
(6/7): libstdc++-4.4.7-17.el6.i686.rpm | 302 kB 00:00
(7/7): libstdc++-devel-4.4.7-17.el6.i686.rpm | 1.6 MB 00:00
--------------------------------------------------------------------------------
Total 3.4 MB/s | 18 MB 00:05
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : libgcc-4.4.7-17.el6.i686 1/12
Updating : libstdc++-4.4.7-17.el6.i686 2/12
Installing : libstdc++-devel-4.4.7-17.el6.i686 3/12
Updating : libgomp-4.4.7-17.el6.i686 4/12
Updating : cpp-4.4.7-17.el6.i686 5/12
Updating : gcc-4.4.7-17.el6.i686 6/12
Installing : gcc-c++-4.4.7-17.el6.i686 7/12
Cleanup : gcc-4.4.7-4.el6.i686 8/12
Cleanup : libstdc++-4.4.7-4.el6.i686 9/12
Cleanup : libgcc-4.4.7-4.el6.i686 10/12
Cleanup : cpp-4.4.7-4.el6.i686 11/12
Cleanup : libgomp-4.4.7-4.el6.i686 12/12
Verifying : libstdc++-devel-4.4.7-17.el6.i686 1/12
Verifying : libgcc-4.4.7-17.el6.i686 2/12
Verifying : cpp-4.4.7-17.el6.i686 3/12
Verifying : libstdc++-4.4.7-17.el6.i686 4/12
Verifying : gcc-4.4.7-17.el6.i686 5/12
Verifying : libgomp-4.4.7-17.el6.i686 6/12
Verifying : gcc-c++-4.4.7-17.el6.i686 7/12
Verifying : libstdc++-4.4.7-4.el6.i686 8/12
Verifying : gcc-4.4.7-4.el6.i686 9/12
Verifying : libgcc-4.4.7-4.el6.i686 10/12
Verifying : libgomp-4.4.7-4.el6.i686 11/12
Verifying : cpp-4.4.7-4.el6.i686 12/12
Installed:
gcc-c++.i686 0:4.4.7-17.el6
Dependency Installed:
libstdc++-devel.i686 0:4.4.7-17.el6
Dependency Updated:
cpp.i686 0:4.4.7-17.el6 gcc.i686 0:4.4.7-17.el6
libgcc.i686 0:4.4.7-17.el6 libgomp.i686 0:4.4.7-17.el6
libstdc++.i686 0:4.4.7-17.el6
Complete!

4.然后再次运行./build.sh就可以了,不过”arm-qte-4.8.5-20131207.tar.gz“的安装时间很长。