0

I have written a small node C++ addon. On Linux I could compile and use it (with the help of node-gyp). But now I'd like to test the addon on my phone(armv7), so I compile and link it with cross-compiler, libv8.so and libnode.so(arm architecture), then push it into phone.

But on adb shell I get the error info when using it:

node: symbol lookup error: /bitmap.node: undefined symbol:
_ZN6bitmap9ImageData4InitEN2v85LocalINS1_6ObjectEEE

which means bitmap::ImageData::Init(v8::Local<v8::Object>) cannot be found...

Why and how should I solve it? Thank you in advance!

Lw Cui
  • 483
  • 7
  • 15
  • I just created an overview of current approaches (see section Compilation): [Viable options to running NodeJS on Android (Aug 2017)](https://stackoverflow.com/a/45649995/8295283) – Arnold Schrijver Aug 12 '17 at 15:02

1 Answers1

0

I just set the appropriate CXX environment variables before invoking node-gyp -arch=arm ... and it works!

Lw Cui
  • 483
  • 7
  • 15
  • Could you please elaborate how you've set those CXX environment variables and to what? Thanks :) – FMA Jun 10 '17 at 17:10
  • @FMA Hi. You should set it to the path to your cross compiler otherwise others couldn't provide correct name mangling so that some methods (if not all) "cannot be found " – Lw Cui Jun 11 '17 at 00:50
  • Can you share toturial or example pls. `ERR_MODULE_NOT_FOUND` when import my node addon – Trương Quốc Khánh Mar 12 '22 at 05:58