前提・実現したいこと
cygwin64にmecab0.996をインストールしたいのですが、makeの段階で以下のエラーメッセージが発生しました。
libiconv,libtoolなど必要なものは入っていると思います。
発生している問題・エラーメッセージ
*** Warning: This system can not link to static lib archive /usr/local/lib/libiconv.la. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have. libtool: link: rm -fr .libs/libmecab.dll.a libtool: link: g++ -shared -nostdlib /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/crtbeginS.o .libs/viterbi.o .libs/tagger.o .libs/utils.o .libs/eval.o .libs/iconv_utils.o .libs/dictionary_rewriter.o .libs/dictionary_generator.o .libs/dictionary_compiler.o .libs/context_id.o .libs/connector.o .libs/nbest_generator.o .libs/writer.o .libs/string_buffer.o .libs/param.o .libs/tokenizer.o .libs/char_property.o .libs/dictionary.o .libs/feature_index.o .libs/lbfgs.o .libs/learner_tagger.o .libs/learner.o .libs/libmecab.o -L/usr/local/lib -lpthread -lstdc++ -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0 -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/lib/../lib -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/lib -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../.. -lstdc++ -lgcc_s -lgcc -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/crtend.o -O3 -o .libs/cygmecab-2.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libmecab.dll.a .libs/viterbi.o:viterbi.cpp:(.text+0x166): undefined reference to `void std::vector<mecab_path_t*, std::allocator<mecab_path_t*> >::emplace_back<mecab_path_t*>(mecab_path_t*&&)' .libs/viterbi.o:viterbi.cpp:(.text+0x166): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `void std::vector<mecab_path_t*, std::allocator<mecab_path_t*> >::emplace_back<mecab_path_t*>(mecab_path_t*&&)' .libs/viterbi.o:viterbi.cpp:(.text+0x193c): undefined reference to `std::vector<std::pair<char*, char*>, std::allocator<std::pair<char*, char*> > >::reserve(unsigned long)' .libs/viterbi.o:viterbi.cpp:(.text+0x193c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `std::vector<std::pair<char*, char*>, std::allocator<std::pair<char*, char*> > >::reserve(unsigned long)' (中略) >::emplace_back<std::string>(std::string&&)' .libs/utils.o:utils.cpp:(.text+0xb34): undefined reference to `void std::vector<std::string, std::allocator<std::string> >::emplace_back<std::string>(std::string&&)' .libs/iconv_utils.o:iconv_utils.cpp:(.text+0x4c): undefined reference to `libiconv_close' .libs/iconv_utils.o:iconv_utils.cpp:(.text+0x140): undefined reference to `libiconv_open' .libs/iconv_utils.o:iconv_utils.cpp:(.text+0x518): undefined reference to `libiconv' .libs/iconv_utils.o:iconv_utils.cpp:(.text+0x543): undefined reference to `libiconv' .libs/iconv_utils.o:iconv_utils.cpp:(.text+0x14): undefined reference to `libiconv_close' .libs/param.o:param.cpp:(.text+0x263d): undefined reference to `void std::vector<std::string, std::allocator<std::string> >::emplace_back<std::string>(std::string&&)' .libs/tokenizer.o:tokenizer.cpp:(.text$_ZNK5MeCab9TokenizerI12mecab_node_t12mecab_path_tE10getBOSNodeEPNS_9AllocatorIS1_S2_EE[_ZNK5MeCab9TokenizerI12mecab_node_t12mecab_path_tE10getBOSNodeEPNS_9AllocatorIS1_S2_EE]+0xf2): undefined reference to `void std::vector<mecab_node_t*, std::allocator<mecab_node_t*> (中略) .libs/feature_index.o:feature_index.cpp:(.text+0x4ec7): undefined reference to `std::vector<unsigned long, std::allocator<unsigned long> >::_M_default_append(unsigned long)' .libs/feature_index.o:feature_index.cpp:(.text+0x61c7): undefined reference to `void std::vector<std::pair<unsigned long, double>, std::allocator<std::pair<unsigned long, double> > >::emplace_back<std::pair<unsigned long, double> >(std::pair<unsigned long, double>&&)' .libs/feature_index.o:feature_index.cpp:(.text+0x86c8): undefined reference to `void std::vector<double, std::allocator<double> >::emplace_back<double>(double&&)' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:375: libmecab.la] エラー 1 make[2]: ディレクトリ '/usr/src/mecab-0.996/src' から出ます make[1]: *** [Makefile:409: all-recursive] エラー 1 make[1]: ディレクトリ '/usr/src/mecab-0.996' から出ます make: *** [Makefile:282: all] エラー 2
該当のソースコード
cd /usr/src tar zxvf mecab-0.996.tar.gz patch -p1 -d ./mecab-0.996/ < ./mecab-0.996.patch cd ./mecab-0.996 ./configure CPPFLAGS=-DNOMINMAX LIBS="-liconv" --with-charset=utf8 LDFLAGS='-L/usr/local/lib -liconv' make http://chiranoura.nobody.jp/articles/2015-07-24_01_how_to_install_mecab/ を参考に、途中パッチを当てています。
試したこと
configure時にオプションの変更、mecab0.98での代替(こちらもエラー)
補足情報(FW/ツールのバージョンなど)
Windows10 home 64bit
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。