-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linker undefined symbols - ld: Undefined symbols: std::__1::basic_string ...
#1610
Comments
Hi! Thanks for opening your first issue here! 😄 |
Hi, I guess this may be an issue of Cargokit, since flutter_rust_bridge core is just a code generator and is unaware of compilation mechanism. Thus, one way is to google about this, another way is to ask at cargokit. Maybe related: |
ld: Undefined symbols: std::__1::basic_string ...
See: irondash/cargokit#52 |
This irondash/cargokit#52 (comment) helped me with figuring out the solution. Had to change this line: 'OTHER_LDFLAGS' => '-force_load ${BUILT_PRODUCTS_DIR}/librust_lib.a',
Not sure from which project the |
is solved by
So looking at the referenced function e.g. |
From this template: https://github.com/fzyzcjy/flutter_rust_bridge/tree/master/frb_codegen/assets/integration_template
IMHO linking more things will slow down things; but not sure whether the slowdown is visible or not.
Sure! Feel free to PR in e.g. https://cjycode.com/flutter_rust_bridge/manual/troubleshooting (click "edit the page" button at bottom of it). (Let's put it there firstly; I may consider moving that page to somewhere more visible later) |
I had experienced some issues linking CPAL because it uses AudioToolbox.framework and this tips helped me. Just added this framework to be compiled and everything worked. inside rust_builder/ios/rust_builder.podspec |
Thank you @fzyzcjy for updating the troubleshooting guide, wanted to do it sometime, but you were faster 🙂 |
You are welcome! Since you did not reply for a week, I originally thought you do not have the interest to PR. Anyway, looking forward to your future usage and PRs! |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue. |
Describe the bug
Startup of application fails when adding the cargo dependency
surrealdb
with theSpeeDb
backend enabled.Generation of code is successful but running the application crashes right after starting.
Problem is the linker can't find some function
std::basic_string
, which is needed bysurrealdb
.Creating a standalone cargo project with the same dependency and also a Tauri project, is working.
Steps to reproduce
surrealdb = { version = "1.0.2", features = ["kv-speedb"] }
as a depdencey intorust/Cargo.toml
rust/src/api/simple.rs
add this import:use surrealdb::{engine::local::SpeeDb, sql::Thing};
flutter_rust_bridge_codegen generate && flutter run -d macos
Logs
Expected behavior
Starts up normally.
Generated binding code
No response
OS
MacOs
Version of
flutter_rust_bridge_codegen
v2.0.0-dev.12
Flutter info
Version of
clang++
15.0.0 (clang-1500.1.0.2.5)
Additional context
Notebook: Apple M1 (arm)
The text was updated successfully, but these errors were encountered: