JamSpell icon indicating copy to clipboard operation
JamSpell copied to clipboard

dyld: lazy symbol binding failed: Symbol not found: __ZN9NJamSpell10TTokenizerC1Ev

Open loretoparisi opened this issue 5 years ago • 2 comments

I'm working on a nodejs porting. So far I have wrote the node-gyp basic structure, and now I'm going to write the wrapper, but as as I import

#include "jamspell/spell_corrector.hpp"

into the wrapper and instanciate

NJamSpell::TSpellCorrector corrector;
corrector.LoadLangModel(modelPath);

I'm getting the error

dyld: Symbol not found: __ZN9NJamSpell10TTokenizerC1Ev
  Referenced from: /JamSpell/nodejs/build/Release/JamSpell.node
  Expected in: flat namespace

Looking at the source code this should be the Tokenizer referred in lang_model.hpp, not sure why it does not import here.

loretoparisi avatar Nov 27 '19 00:11 loretoparisi

[UPDATE] I did some progress, problem was I was compiling the libraries in contrib, while it's better to include the pre-compiled .a files in the node-gyp definition. Now I can import the headers, but I have problems in loading the model:

#include "wrapper.h"
#include "jamspell/spell_corrector.hpp"
//....
NJamSpell::TSpellCorrector corrector;
  corrector.LoadLangModel("models/en.bin");
  std::string res = NJamSpell::WideToUTF8(corrector.FixFragment(L"I am the begt spell cherken!"));
  std::cout << res << "\n";

This time I get

dyld: lazy symbol binding failed: Symbol not found: __ZN3PHF4hashI10phf_stringEEjP3phfT_
  Referenced from: /JamSpell/nodejs/build/Release/JamSpell.node
  Expected in: flat namespace

dyld: Symbol not found: __ZN3PHF4hashI10phf_stringEEjP3phfT_
  Referenced from: /JamSpell/nodejs/build/Release/JamSpell.node
  Expected in: flat namespace

Abort trap: 6

I think it's related to model loading, because if I put the wrong path like

corrector.LoadLangModel("some_wrong_path.bin");

I get I am the begt spell cherken!, so the framework is loading, but not the model file.

loretoparisi avatar Nov 27 '19 09:11 loretoparisi

Did you solve it?

aramis-it avatar Oct 16 '22 08:10 aramis-it