JamSpell
JamSpell copied to clipboard
dyld: lazy symbol binding failed: Symbol not found: __ZN9NJamSpell10TTokenizerC1Ev
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.
[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.
Did you solve it?