kenlm icon indicating copy to clipboard operation
kenlm copied to clipboard

Several Issues with building on Windows

Open aksharbhatnagar opened this issue 5 years ago • 3 comments

I get the errors: fatal error C1083: Cannot open source file: '..\lm\builder\print.cc': No such file or directory fatal error C1083: Cannot open source file: '..\lm\builder\print.hh': No such file or directory

while building the project lmplz. One can check that both the files actually don't exist in the said location.

Also, earlier there was the issue of duplicate include in kenlm.vxproj where the line <ClCompile Include="..\lm\value_build.cc" /> occurs twice namely on lines 223 and 244 in kenlm.vxproj. I commented one of the lines and it compiled successfully (also had to set the Character Set as "Not Set" in project configuration properties for a "Cannot convert CHAR to LPWSTR" error ) on Visual Studio 2017.

Back to the error in lmplz, commenting the includes for print.cc and print.hh in lmplz.vcxproj solves that error but then I get the LNK2019 errors:

  • unresolved external symbol "public: __thiscall lm::ModelBuffer::ModelBuffer(class StringPiece,bool,bool)" (??0ModelBuffer@lm@@QAE@VStringPiece@@_N1@Z) referenced in function "public: __thiscall lm::builder::Output::Output(class StringPiece,bool,bool)" (??0Output@builder@lm@@QAE@VStringPiece@@_N1@Z) Project: lmplz File: output.obj

  • unresolved external symbol "public: void __thiscall lm::ModelBuffer::Sink(class util::stream::Chains &,class std::vector<unsigned __int64,class std::allocator<unsigned __int64> > const &)" (?Sink@ModelBuffer@lm@@QAEXAAVChains@stream@util@@ABV?$vector@_KV?$allocator@_K@std@@@std@@@Z) referenced in function "public: void __thiscall lm::builder::Output::SinkProbs(class util::stream::Chains &)" (?SinkProbs@Output@builder@lm@@QAEXAAVChains@stream@util@@@Z) Project: lmplz File: output.obj

  • unresolved external symbol "public: void __thiscall lm::ModelBuffer::Source(class util::stream::Chains &)" (?Source@ModelBuffer@lm@@QAEXAAVChains@stream@util@@@Z) referenced in function "public: void __thiscall lm::builder::Output::SinkProbs(class util::stream::Chains &)" (?SinkProbs@Output@builder@lm@@QAEXAAVChains@stream@util@@@Z) Project: lmplz File: output.obj

  • unresolved external symbol "public: void __thiscall lm::PrintARPA::Run(class util::stream::ChainPositions const &)" (?Run@PrintARPA@lm@@QAEXABVChainPositions@stream@util@@@Z) referenced in function "public: void __thiscall util::stream::Thread::operator()<class util::stream::ChainPositions,class lm::PrintARPA>(class util::stream::ChainPositions const &,class lm::PrintARPA &)" (??$?RVChainPositions@stream@util@@VPrintARPA@lm@@@Thread@stream@util@@QAEXABVChainPositions@12@AAVPrintARPA@lm@@@Z) Project: lmplz File: output.obj

  • unresolved external symbol "public: void __thiscall lm::Renumber::Run(class util::stream::ChainPosition const &)" (?Run@Renumber@lm@@QAEXABVChainPosition@stream@util@@@Z) referenced in function "public: void __thiscall util::stream::Thread::operator()<class util::stream::ChainPosition,class lm::Renumber>(class util::stream::ChainPosition const &,class lm::Renumber &)" (??$?RVChainPosition@stream@util@@VRenumber@lm@@@Thread@stream@util@@QAEXABVChainPosition@12@AAVRenumber@lm@@@Z) Project: lmplz File: pipeline.obj

  • unresolved external symbol "class boost::program_options::typed_value<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char> * __cdecl lm::SizeOption(unsigned int &,char const *)" (?SizeOption@lm@@YAPAV?$typed_value@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@D@program_options@boost@@AAIPBD@Z) referenced in function _main Project: lmplz File: lmplz_main.obj

I suspect that these could be due to the missing print.hh and print.cc files.

aksharbhatnagar avatar Jan 29 '20 08:01 aksharbhatnagar

I found print.hh and print.cc inside the $kenlm-dir$\lm\common directory. Compiling was successful for me after adding print.hh, print.cc, renumber.hh, renumber.cc, model_buffer.hh, model_buffer.cc, size_option.hh and size_option.cc from that directory to the lmplz project.

horsti371 avatar Mar 02 '20 16:03 horsti371

Pull request please?

kpu avatar Mar 02 '20 20:03 kpu

@horsti371 okay, will try this

aksharbhatnagar avatar Mar 04 '20 05:03 aksharbhatnagar