hpicgs / node

Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:

Home Page:https://nodejs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling project as shared library, then executing it

someweirdhuman opened this issue · comments

Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.51-3 (2017-12-13) x86_64 GNU/Linux
v10.0.0

Hello, for sake of simplicity i compiled your node-lib-cli# code, started the code as thread, (js) require("lame"), everything works.

But when i compile the same thing, in shared library and then that shared library gets loaded and executed this happens

Error: /home/nodejs/ts/client/node_modules_custom/lame/build/Release/bindings.node: undefined symbol: node_module_register
at Object.Module._extensions..node (module.js:695:18)
at Module.load (module.js:577:32)
at tryModuleLoad (module.js:517:12)
at Function.Module._load (module.js:509:3)
at Module.require (module.js:614:17)
at require (internal/module.js:20:18)
at bindings (/home/nodejs/ts/client/node_modules/bindings/bindings.js:81:44)
at Object. (/home/nodejs/ts/client/node_modules_custom/lame/lib/bindings.js:1:99)
at Module._compile (module.js:666:30)
at Object.Module._extensions..js (module.js:677:10)

Any idea why?
I heard this happens when its built as static library etc, also it needs ot have whole lib loading logic in itself, anyone ever had this problem, solved it?