Dynamic library does not appear when compiling with Debian but appears with Manjaro

22 views Asked by At

I'm trying to create Node.js bindings for the Google's cld3 library. Node.js bindings are just a shared library that Node.js can use and map to Javascript code.

I have an error when running my Node.js program on anything else than Manjaro.

The error says that there is an undefined symbol:

$ docker run --rm -it node-cld3:node                               

> [email protected] test
> node --test

 node:internal/modules/cjs/loader:1341
   return process.dlopen(module, path.toNamespacedPath(filename));
                  ^
 
 Error: /build/build/Release/cld3.node: undefined symbol: _ZNK6google8protobuf11MessageLite25InitializationErrorStringEv
     at Module._extensions..node (node:internal/modules/cjs/loader:1341:18)
     at Module.load (node:internal/modules/cjs/loader:1113:32)
     at Module._load (node:internal/modules/cjs/loader:960:12)
     at Module.require (node:internal/modules/cjs/loader:1137:19)
     at require (node:internal/modules/helpers:121:18)
     at bindings (/build/node_modules/bindings/bindings.js:112:48)
     at Object.<anonymous> (/build/index.cjs:4:33)
     at Module._compile (node:internal/modules/cjs/loader:1255:14)
     at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
     at Module.load (node:internal/modules/cjs/loader:1113:32) {
   code: 'ERR_DLOPEN_FAILED'
 }

I found that the Node.js bindings list different dynamic libraries depending wether I compile with Manjaro or Debian. When compiling with Manjaro, the libprotobuf-lite.so is listed and I can run the program.

I am using CMake for the compilation, a reproducible example is available on Github https://github.com/Aschen/node-cld3

enter image description here

How is it possible to have the libprotobuf-lite.so listed on one case and not the other?

0

There are 0 answers