CPAN失败的Perl模块安装

时间:2016-01-07 09:21:30

标签: perl cpan

我正在尝试从CPAN安装模块Algorithm::SVM,但我收到下面列出的错误。在消息中它说"失败"。可能是什么错误?

*kadir@kadir-Inspiron-N5010:cpan install Algorithm::SVM
Reading '/home/kadir/.cpan/Metadata'
  Database was generated on Thu, 07 Jan 2016 07:54:01 GMT
Running install for module 'Algorithm::SVM'

......

Makefile:350: recipe for target 'bindings.o' failed

make: *** [bindings.o] Error 1

  LAIRDM/Algorithm-SVM-0.13.tar.gz

  /usr/bin/make -- NOT OK*

1 个答案:

答案 0 :(得分:1)

如果您正在使用Debian,请转到模块的构建位置(在运行cpan Algorithm :: SVM之后):

sudo vim /home/youruser/.cpan/build/Algorithm-SVM-0.13-biHfmx/bindings.h

在此区域添加以下两行:

using namespace std; 

#include <vector> 
#include <map> 
#include <assert.h> 
#include <cstdlib>         <=====  Add these
#include <string.h>        <=====  two lines

保存并退出并从此处重建模块:

sudo make
sudo make install

测试安装是否成功:

sudo cpan Algorithm::SVM

以下是有关此问题的更详细说明:https://rt.cpan.org/Public/Bug/Display.html?id=43669