请帮我解决这个问题。我正在尝试在 Ubuntu 中安装 Perl 模块Set::IntervalTree
。我反复收到以下错误:
cpan[1]> install Set::IntervalTree
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
Database was generated on Tue, 14 May 2013 05:29:04 GMT
Running install for module 'Set::IntervalTree'
CPAN: YAML loaded ok (v0.84)
Running make for B/BE/BENBOOTH/Set-IntervalTree-0.07.tar.gz
CPAN: Digest::SHA loaded ok (v5.47)
CPAN: Compress::Zlib loaded ok (v2.02)
Checksum for /root/.cpan/sources/authors/id/B/BE/BENBOOTH/Set-IntervalTree-0.07.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
CPAN: Archive::Tar loaded ok (v1.52)
Set-IntervalTree-0.07/
Set-IntervalTree-0.07/src/
Set-IntervalTree-0.07/lib/
Set-IntervalTree-0.07/Changes
Set-IntervalTree-0.07/MANIFEST
Set-IntervalTree-0.07/t/
Set-IntervalTree-0.07/typemap
Set-IntervalTree-0.07/perlobject.map
Set-IntervalTree-0.07/IntervalTree.xs
Set-IntervalTree-0.07/Makefile.PL
Set-IntervalTree-0.07/README
Set-IntervalTree-0.07/META.yml
Set-IntervalTree-0.07/META.json
Set-IntervalTree-0.07/t/Set-IntervalTree.t
Set-IntervalTree-0.07/lib/Set/
Set-IntervalTree-0.07/lib/Set/IntervalTree.pm
Set-IntervalTree-0.07/src/Makefile
Set-IntervalTree-0.07/src/interval_tree.h
Set-IntervalTree-0.07/src/test_main.cc
CPAN: File::Temp loaded ok (v0.22)
CPAN.pm: Going to build B/BE/BENBOOTH/Set-IntervalTree-0.07.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for Set::IntervalTree
Writing MYMETA.yml and MYMETA.json
cp lib/Set/IntervalTree.pm blib/lib/Set/IntervalTree.pm
AutoSplitting blib/lib/Set/IntervalTree.pm (blib/lib/auto/Set/IntervalTree)
/usr/bin/perl /usr/share/perl/5.10/ExtUtils/xsubpp -C++ -typemap /usr/share/perl/5.10/ExtUtils/typemap -typemap perlobject.map -typemap typemap IntervalTree.xs > IntervalTree.xsc && mv IntervalTree.xsc IntervalTree.c
c++ -c -Isrc -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -DVERSION=\"0.07\" -DXS_VERSION=\"0.07\" -fPIC "-I/usr/lib/perl/5.10/CORE" -Isrc IntervalTree.c
/bin/sh: c++: not found
make: *** [IntervalTree.o] Error 127
BENBOOTH/Set-IntervalTree-0.07.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
BENBOOTH/Set-IntervalTree-0.07.tar.gz : make NO
cpan[2]>
答案1
看一下错误信息的这一部分:
c++: not found
如果您输入失败的命令,ubuntu 会告诉您哪个包提供了它:
$ c++
程序‘c++’可以在以下软件包中找到: -克++ - 铿锵有力
输入此命令来安装它:
sudo apt-get install g++
希望这可以帮助