Closed Barugon closed 4 years ago
You don't seem to be using qualified names for the macros, did you add a use gdnative::*;
or #[macro_use] extern crate gdnative;
to your file?
There seems to be something wrong with the crates.io entry for this crate.
I had this issue too, after I replaced gdnative = "0.5.0"
in the dependencies with
[depencdencies.gdnative]
git = "git://github.com/GodotNativeTools/godot-rust"
and replaced
#[derive(NativeClass)]
> #[derive(gdnative::NativeClass)]
#[inherit(Node)]
> #[inherit(gdnative::Node)]
#[methods]
> #[gdnative::methods]
(edition 2018 BTW)
it worked
edit: I have to mention I didn't use the hello world example directly, I created my own project with the same code as the hello world example
Yes, the newest version with the procedural macros is not on crates.io yet. It has to be a git (or path) dependency for now.
Thanks @T0mstone. I'll give that a try.
[edit] It works. BTW, I didn't need to qualify the macro names i.e. gdnative::NativeClass
.
Closing this issue since it works, although it really should mention in the readme that you need the github version of gdnative.
I also think the readme should have some kind of warning about this, and also links to a version of the examples which works with the package published on crate.io.
This appears to still be a thing? I also had to switch to the Git version in order to build the code that's in the README.md, which is confusing. If the README.md instructions are going to sometimes not work between releases, maybe don't even include them? Or maybe them super generic, like showing how to install the Git version or crate.io version, and then tell users to run cargo doc
to get more information?
In the readme, this:
[dependencies]
gdnative = "0.5.0"
should probably be replaced with this:
[dependencies]
gdnative = { git = "git://github.com/GodotNativeTools/godot-rust" }
Thanks @karroffel
I get the following errors (rust 1.34.1):