linux + g ++:找不到命令


43

我想在我的Linux red-hat机器上安装gettext-0.19.1.tar.xz。

首先,我执行以下操作

cd gettext-0.19.1
./configure
make

在make失败期间g++: command not found

libtool: compile:  g++ -DIN_LIBASPRINTF -DHAVE_CONFIG_H -I. -c autosprintf.cc  - o .libs/autosprintf.o
./libtool: line 1128: g++: command not found
make[5]: *** [autosprintf.lo] Error 1
make[5]: Leaving directory `/var/tmp/gettext-0.19.1/gettext-runtime/libasprintf'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/var/tmp/gettext-0.19.1/gettext-runtime/libasprintf'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/gettext-0.19.1/gettext-runtime'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/gettext-0.19.1/gettext-runtime'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/gettext-0.19.1'
make: *** [all] Error 2

我该如何解决?

备注-我有GCC

which gcc
/usr/bin/gcc

5
您正在破坏系统。要安装新软件,您应该使用yum现有的存储库。在以root用户身份输入任何其他命令之前,请先停止阅读RedHat自己的手册。
— Deer Hunter 2014年

2
我想知道是否应该没有关于命令未找到错误的规范问题。
— Cristian Ciupitu 2014年

Answers:


75

首先安装开发工具套件。然后回去编译软件。

yum groupinstall 'Development Tools'

您可能需要的不仅仅是编译器。该开发工具包包括核心开发工具,如automake,gcc,perl,python,flex,make,gdb,bison,等等。要列出软件包组中的所有软件,请使用yum以下方法。

yum group info 'Development Tools'

对于Fedora 20(至少),您还需要安装gcc-c++。

对于基于Debian的系统,请按照以下步骤安装开发工具套件。

apt-get install build-essential

在虚空的Linux,它的xbps-install -Su base-devel,它提供了m4,autoconf,automake,bc,binutils,bison,ed,libfl-devel,flex,libgcc-devel,kernel-libc-headers,glibc-devel,isl,cloog,mpfr,libmpc,gcc,libstdc++-devel,gcc-c++,gettext-libs,gettext,groff,libtool,make,patch,pkg-config,texinfo,unzip,和xz。


我有perl版本-v5.10.1
— maihabunash 2014年

下载gcc-c ++,但仍然存在相同的问题
— maihabunash 2014年

现在我可以使用yum了,但是它在GPG密钥检索上失败了:[错误14]无法打开/读取文件:/// etc / pki / rpm-gpg / RPM-GPG-KEY-oracle:
— maihabunash

然后跑步yum update
— Christopher

在FC20上sudo yum group install "Development Tools"无法安装g ++。为此,您还需要sudo yum install gcc-g++
— 滚刀

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.