katyo / oboe-rs

Rust bindings for Oboe high-performance audio IO Android library
65 stars 22 forks source link

dlopen failed: cannot locate symbol #2

Closed inferrna closed 3 years ago

inferrna commented 4 years ago

Each error in android log starts with "Load libary ERROR: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol ..." so I skip it. But with different option lost symbol is also different:

  1. No feature

    "_ZN4oboe30AudioStreamBuilder_setCallbackEPNS_18AudioStreamBuilderEPNS_26AudioStreamCallbackWrapperE"
  2. features = ["compile-library", "static-link"]
    "_ZN4oboe26AudioStreamCallbackWrapper10setContextEPv"
  3. features = ["static-link"]
    "_ZN4oboe30AudioStreamBuilder_setCallbackEPNS_18AudioStreamBuilderEPNS_26AudioStreamCallbackWrapperE"
  4. features = ["compile-library"]
    "_ZN4oboe23AudioStream_requestStopEPNS_11AudioStreamE"
inferrna commented 4 years ago

My android app based on https://github.com/Dushistov/rust_swig crate. I just added your "play sine" example to it's example app and got the same error. Can you please look on it? https://github.com/inferrna/rust_swig - to build it disable features = ["generate-bindings"] in Cargo.toml

inferrna commented 4 years ago

I just found that there is no build.rs file in oboe-sys from crates.io. Very possible it's the reason.

katyo commented 4 years ago

Can you test current version from this repo?

inferrna commented 4 years ago

When build from git https://github.com/katyo/oboe-rs/issues/3

katyo commented 3 years ago

Unfortunately I have similar issue (oboe::flowgraph::MultiToMonoConverter::MultiToMonoConverter(int)):

Unable to load native library "/data/app/rust.oboe_demo-Oy18rWKbgxhoabtxhXaTPQ==/lib/arm64/liboboe_demo.so": dlopen failed: cannot locate symbol "_ZN4oboe9flowgraph20MultiToMonoConverterC1Ei" referenced by "/data/app/rust.oboe_demo-Oy18rWKbgxhoabtxhXaTPQ==/lib/arm64/liboboe-ext.so
katyo commented 3 years ago

When static linking is used I have another unresolved symbol (std::__ndk1::__shared_weak_count::lock()):

Unable to load native library "/data/app/rust.oboe_demo-1UsbLwVJVHU0vrkEAzLqNQ==/lib/arm64/liboboe_demo.so": dlopen failed: cannot locate symbol "_ZNSt6__ndk119__shared_weak_count4lockEv" referenced by "/data/app/rust.oboe_demo-1UsbLwVJVHU0vrkEAzLqNQ==/lib/arm64/liboboe_demo.so"
katyo commented 3 years ago

It seems I just forgot to update cmake rules. This issue should be solved by #12.