Hi,
I have created a rust lib uses as a wrapper around cpp code, using rustc...below is build.rs used...
....
if cfg!(target_os = "linux"){
//linux only libs
println!("cargo:rustc-env=USE_OPENSSL=ON");
println!("cargo:rustc-env=LDFLAGS=-Wl,--copy-dt-needed-entries");
println!("cargo:rustc-link-lib=static=s2n");
// Link against the necessary OpenSSL libraries
println!("cargo:rustc-link-lib=dylib=ssl");
println!("cargo:rustc-link-lib=dylib=crypto");
}
I add this lib as a dependency to my main app in cargo.toml, all good -- it compiles fine and runs.
Now I add another library "http-auth" as a dependancy in cargo.toml of my main app and try to use a function from it.....I get the below error when doing
cargo build
,
= note: /usr/bin/ld: /home/trane/denali-modularapps/target/debug/deps/libopenssl-3aa17f19c5f8efdf.rlib(openssl-3aa17f19c5f8efdf.openssl.39ed50b012af3ec4-cgu.09.rcgu.o): undefined reference to symbol 'EVP_sm3@@OPENSSL_3.0.0'
/usr/bin/ld: /lib/x86_64-linux-gnu/libcrypto.so.3: error adding symbols: DSO missing from command line*
collect2: error: ld returned 1 exit status*
How to resolve this, appreciate any help!