I've posted this linking error in github under the CXX project.. but was told it's a basic linking problem
build.rs snippet showing the linking
if let Some(build_info) = command.generate() {
println!("using conan build info");
build_info.cargo_emit();
// requires : sudo apt install libintelrdfpmath-dev
println!("cargo:rustc-link-lib=bidgcc000");
let twsapi = build_info.get_dependency("twsapi").unwrap();
My question or .. confusion is.. I can see in the output of cargo .. the needed library is indeed linked. I had this working with the same library name using GCC, Conan + Cmake .. any ideas ?
The linking line in output showing BigDecimal is getting linked
...
-l twsapi -l bidgcc000 -l static=twsapi-grpc-server
...
Full error -vv
output
cargo -vv build
Fresh unicode-ident v1.0.5
Fresh proc-macro2 v1.0.47
Fresh cc v1.0.74
Fresh quote v1.0.21
Fresh syn v1.0.103
Fresh autocfg v1.1.0
Fresh memchr v2.5.0
Fresh serde_derive v1.0.147
Fresh libc v0.2.137
Fresh serde v1.0.147
Fresh aho-corasick v0.7.19
Fresh itoa v1.0.4
Fresh unicode-width v0.1.10
Fresh termcolor v1.1.3
Fresh cxxbridge-flags v1.0.80
Fresh ryu v1.0.11
Fresh hashbrown v0.12.3
Fresh regex-syntax v0.6.28
Fresh codespan-reporting v0.11.1
Fresh serde_json v1.0.87
Fresh indexmap v1.9.1
Fresh regex v1.7.0
Fresh scratch v1.0.2
Fresh which v3.1.1
Fresh once_cell v1.16.0
Fresh lazy_static v1.4.0
Fresh cxx-build v1.0.80
Fresh conan v0.3.0
Fresh link-cplusplus v1.0.7
Fresh cxxbridge-macro v1.0.80
Fresh cxx v1.0.80
Compiling twsapi_grpc_server v0.1.0 (/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan)
Running `CARGO=/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo CARGO_BIN_NAME=twsapi_grpc_server CARGO_CRATE_NAME=twsapi_grpc_server CARGO_MANIFEST_DIR=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=twsapi_grpc_server CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps:/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib:/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib' OUT_DIR=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out rustc --crate-name twsapi_grpc_server --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=31dabbf2020c25bc -C extra-filename=-31dabbf2020c25bc --out-dir /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps -C incremental=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/incremental -L dependency=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps --extern cxx=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/libcxx-e660790e1f7f49f6.rlib -L native=/home/emcp/.conan/data/twsapi/10.17.01/stonks/prod/package/062863c92a5a0a247840166e9f84ebe8d10786b9/lib -L native=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out -l twsapi -l bidgcc000 -l static=twsapi-grpc-server -L native=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/cxx-2e969b8bdfcbd239/out -L native=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/link-cplusplus-44a675db9679e2d8/out`
warning: associated function `connect` is never used
--> src/main.rs:12:12
|
12 | fn connect(self: Pin<&mut TWSApiClient>, port: i32, client_id: i32) -> bool;
| ^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-m64" "/tmp/rustcScqQxU/symbols.o" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/twsapi_grpc_server-31dabbf2020c25bc.1d92v3r0vmd3hvvg.rcgu.o" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/twsapi_grpc_server-31dabbf2020c25bc.1nh99hc21zinxz7s.rcgu.o" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/twsapi_grpc_server-31dabbf2020c25bc.24qozlciljoaxs5a.rcgu.o" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/twsapi_grpc_server-31dabbf2020c25bc.2fe1xsqetjprzy2j.rcgu.o" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/twsapi_grpc_server-31dabbf2020c25bc.2ycclp3yr5z52r58.rcgu.o" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/twsapi_grpc_server-31dabbf2020c25bc.3zh79xd7pkugfk00.rcgu.o" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/twsapi_grpc_server-31dabbf2020c25bc.4j9s3lz2egiynkrk.rcgu.o" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/twsapi_grpc_server-31dabbf2020c25bc.ni02lla60j44bq2.rcgu.o" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/twsapi_grpc_server-31dabbf2020c25bc.1cyl86w9xo3t9whg.rcgu.o" "-Wl,--as-needed" "-L" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps" "-L" "/home/emcp/.conan/data/twsapi/10.17.01/stonks/prod/package/062863c92a5a0a247840166e9f84ebe8d10786b9/lib" "-L" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out" "-L" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/cxx-2e969b8bdfcbd239/out" "-L" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/link-cplusplus-44a675db9679e2d8/out" "-L" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-ltwsapi" "-lbidgcc000" "-Wl,-Bstatic" "-ltwsapi-grpc-server" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/libcxx-e660790e1f7f49f6.rlib" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/liblink_cplusplus-6d16bbc257cb1393.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-05737cf45bd30456.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-9f873b61fdec9b03.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-7f13930fcac1846f.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-098633b847612f3b.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-f14b73d282b0245e.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-2c5b4433ebc1d822.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-59591a7b405fe395.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-384947c6d5f697ff.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-b08a86c6880b47a8.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-58adeee671f9ba8e.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-f156b880fc73e7f0.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-4458c5022988e1ab.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-02e61e5ec4aa9e8b.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-a0d9b33b5161957b.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-04cec55a79224c36.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-3fb6d8496dc7d6a6.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-7d46c016841a97d4.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-a1f7b8b60464cc57.rlib" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-272ca28f0b8538d5.rlib" "-Wl,-Bdynamic" "-lstdc++" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/twsapi_grpc_server-31dabbf2020c25bc" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs"
= note: /usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out/libtwsapi-grpc-server.a(twsapi-client.o): in function `decimalToString[abi:cxx11](unsigned long long)':
/home/emcp/.conan/data/twsapi/10.17.01/stonks/prod/package/062863c92a5a0a247840166e9f84ebe8d10786b9/include/Decimal.h:68: undefined reference to `__bid64_to_string'
/usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out/libtwsapi-grpc-server.a(twsapi-client.o): in function `com::enserio::TWSApiClient::TWSApiClient()':
/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/src/twsapi-client.cc:53: undefined reference to `EReaderOSSignal::EReaderOSSignal(unsigned long)'
/usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/src/twsapi-client.cc:54: undefined reference to `EClientSocket::EClientSocket(EWrapper*, EReaderSignal*)'
/usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/src/twsapi-client.cc:58: undefined reference to `EReaderOSSignal::~EReaderOSSignal()'
/usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out/libtwsapi-grpc-server.a(twsapi-client.o): in function `com::enserio::TWSApiClient::~TWSApiClient()':
/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/src/twsapi-client.cc:66: undefined reference to `EReaderOSSignal::~EReaderOSSignal()'
/usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out/libtwsapi-grpc-server.a(twsapi-client.o): in function `com::enserio::TWSApiClient::connectAck()':
/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/src/twsapi-client.cc:183: undefined reference to `EClientSocket::asyncEConnect() const'
/usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/src/twsapi-client.cc:185: undefined reference to `EClient::startApi()'
/usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out/libtwsapi-grpc-server.a(twsapi-client.o): in function `com::enserio::TWSApiClient::error(int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/src/twsapi-client.cc:286: undefined reference to `EClient::cancelMktData(long)'
/usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out/libtwsapi-grpc-server.a(twsapi-client.o): in function `com::enserio::TWSApiClient::verifyAndAuthCompleted(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/src/twsapi-client.cc:507: undefined reference to `EClient::startApi()'
/usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out/libtwsapi-grpc-server.a(twsapi-client.o): in function `com::enserio::TWSApiClient::softDollarTiers(int, std::vector<SoftDollarTier, std::allocator<SoftDollarTier> > const&)':
/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/src/twsapi-client.cc:551: undefined reference to `SoftDollarTier::displayName[abi:cxx11]() const'
/usr/bin/ld: /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out/libtwsapi-grpc-server.a(twsapi-client.o): in function `std::default_delete<EReader>::operator()(EReader*) const':
/usr/include/c++/11/bits/unique_ptr.h:85: undefined reference to `EReader::~EReader()'
collect2: error: ld returned 1 exit status
= help: 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)
warning: `twsapi_grpc_server` (bin "twsapi_grpc_server") generated 1 warning
error: could not compile `twsapi_grpc_server` due to previous error; 1 warning emitted
Caused by:
process didn't exit successfully: `CARGO=/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo CARGO_BIN_NAME=twsapi_grpc_server CARGO_CRATE_NAME=twsapi_grpc_server CARGO_MANIFEST_DIR=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=twsapi_grpc_server CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps:/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib:/home/emcp/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib' OUT_DIR=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out rustc --crate-name twsapi_grpc_server --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=31dabbf2020c25bc -C extra-filename=-31dabbf2020c25bc --out-dir /home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps -C incremental=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/incremental -L dependency=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps --extern cxx=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/deps/libcxx-e660790e1f7f49f6.rlib -L native=/home/emcp/.conan/data/twsapi/10.17.01/stonks/prod/package/062863c92a5a0a247840166e9f84ebe8d10786b9/lib -L native=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/twsapi_grpc_server-f1ae9ab28f1e650b/out -l twsapi -l bidgcc000 -l static=twsapi-grpc-server -L native=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/cxx-2e969b8bdfcbd239/out -L native=/home/emcp/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan/target/debug/build/link-cplusplus-44a675db9679e2d8/out` (exit status: 1)
emcp@mba-kubuntu-22:~/Dev/git/JRGEMCP_Bootstrapping/bootstrap-rust-cpp-conan$