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

godot-rust is not working on macos (using dylib and not dll) #938

Closed
ghost opened this issue Sep 3, 2022 · 9 comments
Closed

godot-rust is not working on macos (using dylib and not dll) #938

ghost opened this issue Sep 3, 2022 · 9 comments
Labels

Comments

@ghost
Copy link

ghost commented Sep 3, 2022

I am following the hello world example on macos. I have followed all the steps but i keep getting an error:

Error loading GDNative file res://bin/warbath.dylib: GodotEngine v4.* is not yet supported. See #396

i am using godot 3.5 stable, godot-rust 0.10.0, rustc version 1.62.1

i am guessing that it is because i am trying to use a dylib instead of dll. but macos rust only produces dylib.

@ghost ghost added the bug label Sep 3, 2022
@Bromeon
Copy link
Member

Bromeon commented Sep 3, 2022

Since you're using Godot 3.5, can you check if #910 works for you?

You can use that branch as follows:

[dependencies]
gdnative = { git = "https://github.com/Bromeon/godot-rust.git", branch = "feature/godot-3.5" }

[lib]
crate-type = ["cdylib"]

@ghost
Copy link
Author

ghost commented Sep 3, 2022

It worked!!

@ghost
Copy link
Author

ghost commented Sep 3, 2022

Since you're using Godot 3.5, can you check if #910 works for you?

You can use that branch as follows:

[dependencies]
gdnative = { git = "https://github.com/Bromeon/godot-rust.git", branch = "feature/godot-3.5" }

[lib]
crate-type = ["cdylib"]

Thank you so much

@Bromeon
Copy link
Member

Bromeon commented Sep 3, 2022

Happy to hear that, and thanks for trying that branch!
Every person testing it increases the confidence in our Godot 3.5 support 🙂

@Bromeon Bromeon closed this as completed Sep 3, 2022
@Bromeon Bromeon added question and removed bug labels Sep 3, 2022
@ghost
Copy link
Author

ghost commented Sep 3, 2022

Any ideas how i can automate the build and import to godot? having to copy lib files after editing gets difficult with multiple files and frequent changes.

@Bromeon
Copy link
Member

Bromeon commented Sep 3, 2022

The gdnlib path can refer to something outside the Godot repository, e.g. res://../rust/target/debug/game-logic.dylib.
This way, you don't need to copy lib files, but you may need to minimize (not close) Godot when you build Rust.

Note that this only works during development -- once you export your Godot project, the res:// path needs to refer to libraries inside.

You can also further automate things with bash scripts, for example:

# assuming you have this directory strucure:
# 
# game/
#   godot/
#      project.godot
#   rust/
#      src/
#      target/
#      Cargo.toml

# godot is an alias/symlink to the Godot executable
cargo build --manifest-path rust/Cargo.toml && godot --path godot

Also don't hesitate to join our Discord server in case of further questions 🙂

Edit: updated Discord link

@ghost
Copy link
Author

ghost commented Sep 15, 2022

Hey. The invite is not working

@Bromeon
Copy link
Member

Bromeon commented Sep 16, 2022

@hirohido I just tried my link and get to the Discord page, and asked about account details. If I randomly change the link, it tells me the invitation is invalid. What error do you get?

That said, that link is pretty ancient and I could probably create a new one.

@ghost
Copy link
Author

ghost commented Sep 16, 2022

It works now. Thanks

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

No branches or pull requests

1 participant