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

FYI [wasm] the name of your rust library MUST be different than the godot project name #934

Open
0x53A opened this issue Oct 29, 2024 · 2 comments
Labels
c: wasm WebAssembly export target quality-of-life No new functionality, but improves ergonomics/internals

Comments

@0x53A
Copy link
Contributor

0x53A commented Oct 29, 2024

I tried to get wasm export to work but would always get the error

Can't resolve symbol gdext_rust_init. Error: Tried to lookup unknown symbol "gdext_rust_init" in dynamic lib: game.wasm

That is, until I stumbled upon someone having the same issue and posting the solution: https://discord.com/channels/723850269347283004/1288906885746917447

Turns out, godot itself exports a file named <projectname>.wasm, so if you have named your rust library the same as your godot project, they will overwrite each other!

@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: wasm WebAssembly export target labels Oct 29, 2024
@Bromeon
Copy link
Member

Bromeon commented Oct 29, 2024

We should add this to the book page, maybe among other similar things to keep in mind 🤔

Also, we can probably validate that they're not equal:

  • application/config/name is the ProjectSettings key for the project name
  • from Cargo env, we can get the library name

@0x53A
Copy link
Contributor Author

0x53A commented Oct 29, 2024

I think this can either be part of the existing web PR (godot-rust/book#56) or I can create a new PR after that one is merged, I'd just rather not mess around with the same article and cause merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: wasm WebAssembly export target quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
Development

No branches or pull requests

2 participants