![../libtool:第 1158 行:g++:未找到命令](https://linux22.com/image/989601/..%2Flibtool%EF%BC%9A%E7%AC%AC%201158%20%E8%A1%8C%EF%BC%9Ag%2B%2B%EF%BC%9A%E6%9C%AA%E6%89%BE%E5%88%B0%E5%91%BD%E4%BB%A4.png)
我在制作 gcc 5.3.0 时遇到了问题。我在 Xubuntu 14.04 LTS 上使用 gcc 4.8。
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ sudo make
make "AR_FLAGS=" "CC_FOR_BUILD=" "CC_FOR_TARGET=" "CFLAGS=-g -O2" "CXXFLAGS=" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS=" "LIBCFLAGS=" "LIBCFLAGS_FOR_TARGET=" "MAKE=make" "MAKEINFO=/bin/sh /mnt/lfs/sources/gcc-5.3.0/missing --run makeinfo " "SHELL=/bin/sh" "RUNTESTFLAGS=" "exec_prefix=/tools" "infodir=/tools/share/info" "libdir=/tools/lib" "includedir=/tools/include" "prefix=/tools" "tooldir=" "gxx_include_dir=/tools/i686-lfs-linux-gnu/include/c++/5.3.0" "AR=ar" "AS=as" "LD=/usr/bin/ld" "RANLIB=ranlib" "NM=nm" "NM_FOR_BUILD=" "NM_FOR_TARGET=" "DESTDIR=" "WERROR=" all-recursive
make[1]: Entering directory `/mnt/lfs/sources/gcc-5.3.0/build'
Making all in include
make[2]: Entering directory `/mnt/lfs/sources/gcc-5.3.0/build/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/mnt/lfs/sources/gcc-5.3.0/build/include'
Making all in libsupc++
make[2]: Entering directory `/mnt/lfs/sources/gcc-5.3.0/build/libsupc++'
/bin/sh ../libtool --tag CXX --tag disable-shared --mode=compile g++ -I/mnt/lfs/sources/gcc-5.3.0/libstdc++-v3/../libgcc -I/mnt/lfs/sources/gcc-5.3.0/build/include/i686-lfs-linux-gnu -I/mnt/lfs/sources/gcc-5.3.0/build/include -I/mnt/lfs/sources/gcc-5.3.0/libstdc++-v3/libsupc++ -prefer-pic -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=del_ops.lo -std=gnu++14 -Wno-sized-deallocation -c ../../libstdc++-v3/libsupc++/del_ops.cc
libtool: compile: g++ -I/mnt/lfs/sources/gcc-5.3.0/libstdc++-v3/../libgcc -I/mnt/lfs/sources/gcc-5.3.0/build/include/i686-lfs-linux-gnu -I/mnt/lfs/sources/gcc-5.3.0/build/include -I/mnt/lfs/sources/gcc-5.3.0/libstdc++-v3/libsupc++ -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=del_ops.lo -std=gnu++14 -Wno-sized-deallocation -c ../../libstdc++-v3/libsupc++/del_ops.cc -fPIC -DPIC -D_GLIBCXX_SHARED -o del_ops.o
../libtool: line 1158: g++: command not found
make[2]: *** [del_ops.lo] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-5.3.0/build/libsupc++'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/gcc-5.3.0/build'
make: *** [all] Error 2
答案1
当我遇到这个问题时,我发现如果你安装 gtk 就可以解决它。
sudo apt-get install libgtk2.0-dev