You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
= note: /usr/lib/gcc/x86_64-w64-mingw32/14.1.1/../../../../x86_64-w64-mingw32/bin/ld: ...target/x86_64-pc-windows-gnu/debug/deps/native_pkcs11-147d60644989332b.native_pkcs11.58a27a5f3321d193-cgu.0.rcgu.o:native_pkcs11.58a2:(.data+0x1a): undefined reference to `C_GetFunctionList'
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#rustc-link-lib)
error: could not compile `native-pkcs11` (lib) due to 1 previous error
This lead me to believe that there was some issue in how C_GetFunctionList was exported from my crate but when removing the feature "custom-function-list" from the native-pkcs11 dependency and restarting the build following message turns up:
multiple definition of C_GetFunctionList'; `
It seems like there is an issue with the order in which the crates are linked.
Description
I am encountering a linker error during the build process for windows targets using a custom function list for native-pkcs11.
How to reproduce
I've uploaded my code to a temp repo:
pscschn/issue-native-pkcs11-rs
Build for a windows target:
cargo build --target x86_64-pc-windows-gnu
Behavior
The build fails with message:
This lead me to believe that there was some issue in how C_GetFunctionList was exported from my crate but when removing the feature "custom-function-list" from the native-pkcs11 dependency and restarting the build following message turns up:
multiple definition of
C_GetFunctionList'; `It seems like there is an issue with the order in which the crates are linked.
Environment
cargo 1.82.0 (8f40fc59f 2024-08-21)
rustc 1.82.0 (f6e511eec 2024-10-15)
x86_64-w64-mingw32-gcc (GCC) 14.1.1 20240607 (Fedora MinGW 14.1.1-3.fc40)
Additional Information
If you need more information I am happy to provide further details.
Thank you in advance.
The text was updated successfully, but these errors were encountered: