Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
loretoparisi opened this issue Nov 27, 2019 · 2 comments

Comments

@loretoparisi
Copy link

loretoparisi commented Nov 27, 2019

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
Copy link
Author

loretoparisi commented Nov 27, 2019

[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.

@aramis-it
Copy link

Did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants