【问题标题】:Error while installating YamCha Package安装 YamCha 包时出错
【发布时间】:2016-09-28 05:52:49
【问题描述】:

我尝试为 NLP 任务安装 YamCha 工具,例如 NER、POS 和分块。

在尝试安装时,我按照安装步骤操作

% ./configure 
% make
% make check
% su
# make install

我收到以下错误消息:-

param.cpp: 在成员函数'bool YamCha::Param::open(int, char**, const YamCha::Option*)'中: param.cpp:102:42: 错误: 'strlen' 未在此范围内声明 size_t nlen = strlen (opts[i].name); ^ param.cpp:103:68:错误:未在此范围内声明“strncmp” if (nlen == len && strncmp (&argv[ind][2], opts[i].name, len) == 0) { ^ param.cpp:在成员函数'bool YamCha::Param::open(const char*, const YamCha::Option*)'中: param.cpp:182:28:错误:未在此范围内声明“strncpy” strncpy (str, arg, 1024); ^ param.cpp:185:12:警告:不推荐将字符串常量转换为 'char*' [-Wwrite-strings] 使所有递归 make1: 进入目录/home/hamada/Documents/YamCha/yamcha-0.33' Making all in src make[2]: Entering directory/home/hamada/Documents/YamCha/yamcha-0.33/src' /bin/bash ../libtool --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -一世。 -I.. -O3 -Wno-deprecated -Wall -c -o param.lo param.cpp g++ -DHAVE_CONFIG_H -I。 -一世。 -I.. -O3 -Wno-deprecated -Wall -c param.cpp -fPIC -DPIC -o .libs/param.o ptr[0] = 包; ^ param.cpp:在成员函数“void YamCha::Param::help(std::ostream&, const YamCha::Option*)”中: param.cpp:205:42: 错误: 'strlen' 未在此范围内声明 size_t l = 1 + strlen (opts[i].name); ^ param.cpp:211:38: 错误: 'strlen' 未在此范围内声明 size_t l = strlen (opts[i].name); ^ make[2]: * [param.lo] 错误 1 make[2]: 离开目录/home/hamada/Documents/YamCha/yamcha-0.33/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/hamada/Documents/YamCha/yamcha-0.33' make: * [all] 错误 2

【问题讨论】:

  • 你的源代码中是否有头文件<string.h>

标签: nlp svm pos-tagger


【解决方案1】:

您的代码文件中缺少一个头文件。您在上面提供的链接包含一个源文件 src/common.h ,只需在此文件中添加 #include<string.h> 即可。有了这个添加,它应该可以工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-23
    • 2018-01-02
    • 2015-10-01
    • 2013-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多