infinyon / infinyon/node-bindgen
undefined reference to `napi_...` issues
- Dominant language
- Rust
- Stars
- 587
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
I'm getting an error:
```
error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH=""
= note: /usr/bin/ld: /home/james/Documents/platform/shared/library/openid_token_verifier/target/release/deps/libnj_core-381c20950f1364ad.rlib(nj_core-381c20950f1364ad.nj_core.3ac555e3-cgu.15.rcgu.o): in function `nj_core::module::init_module':
nj_core.3ac555e3-cgu.15:(.text._ZN7nj_core6module11init_module17h689025d98d800e2fE+0x10): undefined reference to `napi_module_register'
/usr/bin/ld: /home/james/Documents/platform/shared/library/openid_token_verifier/target/release/deps/libnj_core-381c20950f1364ad.rlib(nj_core-381c20950f1364ad.nj_core.3ac555e3-cgu.0.rcgu.o): in function `nj_core::basic::JsExports::define_property':
nj_core.3ac555e3-cgu.0:(.text._ZN7nj_core5basic9JsExports15define_property17h2ddbe1e6c72b4dd1E+0xf5): undefined reference to `napi_define_properties'
collect2: error: ld returned 1 exit status
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
```
Could someone please advise me on what I need to do to get my project building?
Contributor guide
Research direction
Start by reproducing the reported Cargo link failure in the affected project and inspect the build configuration around the missing napi_module_register and napi_define_properties symbols. Check how the Rust Node.js module is linked, then confirm that the project builds successfully without undefined napi references.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, rust
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100