Skip to content
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

Book update: Xcode 15 (at least) requires a bridge in order to import into swift #255

Open
sax opened this issue Mar 13, 2024 · 0 comments

Comments

@sax
Copy link

sax commented Mar 13, 2024

I'm going through the swift-bridge book, and ran into an issue. The Xcode + Cargo guide has one create an empty rust library, and then configure the Xcode project to import it. When my src/lib.rs does not have any contents, then when I try to build the project (Pressing the Run button should now open up the iOS simulator with Xcode's default "Hello World" iOS app.), then my Xcode build fails with a ton of errors: Undefined symbol: ___swift_bridge__$RustStr$partial_eq, ...$_free, ...$as_str, etc.

When I add the mod ffi code to the Rust lib, then the Xcode build succeeds, even when nothing in Swift calls into the lib.

Rust: 1.76.0 (07dca489a 2024-02-04)
Xcode: Version 15.3 (15E204a)

I think this would be solved by reorganizing the page to add the RustApp to the lib before trying to build in Xcode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant