Search code examples
nlpsvmpos-tagger

Error while installating YamCha Package


I try to install YamCha tool for NLP tasks, like NER, POS, and chunking.

While trying to install, I followed the installation steps

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

I got the following error messages:-

param.cpp: In member function 'bool YamCha::Param::open(int, char**, const YamCha::Option*)': param.cpp:102:42: error: 'strlen' was not declared in this scope size_t nlen = strlen (opts[i].name); ^ param.cpp:103:68: error: 'strncmp' was not declared in this scope if (nlen == len && strncmp (&argv[ind][2], opts[i].name, len) == 0) { ^ param.cpp: In member function 'bool YamCha::Param::open(const char*, const YamCha::Option*)': param.cpp:182:28: error: 'strncpy' was not declared in this scope strncpy (str, arg, 1024); ^ param.cpp:185:12: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] make all-recursive make1: Entering directory /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. -I.. -O3 -Wno-deprecated -Wall -c -o param.lo param.cpp g++ -DHAVE_CONFIG_H -I. -I. -I.. -O3 -Wno-deprecated -Wall -c param.cpp -fPIC -DPIC -o .libs/param.o ptr[0] = PACKAGE; ^ param.cpp: In member function 'void YamCha::Param::help(std::ostream&, const YamCha::Option*)': param.cpp:205:42: error: 'strlen' was not declared in this scope size_t l = 1 + strlen (opts[i].name); ^ param.cpp:211:38: error: 'strlen' was not declared in this scope size_t l = strlen (opts[i].name); ^ make[2]: * [param.lo] Error 1 make[2]: Leaving directory /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] Error 2


Solution

  • There is a header file missing in your code files. The link you provided above, contains a source file src/common.h , just add #include<string.h> in this file. With this addition, it should work.