0

I am developing an app using electron.

I have setup an addon that uses c++ code and translated it into nodejs code using NAPI.

Now I want to include an external .so library (with a .h file) but can't find any documents that achieve any success.

I keep getting error: undefined symbol: Some_Function_Name

  • Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Ulrich Eckhardt Oct 14 '18 at 07:38

1 Answers1

1

you can specifiy libraries to link against in the binding.gyp, details is in Node-gyp/C++ import shared library (.so) and How to build nodejs C++ addon depending on a shared library with relative location. when using NAPI you use node-gyp as the toolchain to compile automatically, is a dependency of NAPI

ralf htp
  • 9,149
  • 4
  • 22
  • 34
  • I checked those, seemed I made a silly mistake in my binding.gyp file, the problem was that the "libraries" tag was not included in the "targets" tag I had included it on its own. I am getting some errors now but will debug, thanks – Fady Fadlallah Oct 14 '18 at 09:15