I am following the GDExtension C++ example guide on the docs site, but when running it I am getting an exception thrown when loading the extension and not sure why.
The exception is on the very first line of _bind_methonds() and throws the following error message: Exception: Exception 0x80000003 encountered at address 0x7ffbce231c7e
I actually added the [[nodiscard]] attributes after I ran into this issue in a failed attempt to see if it would fix it. And my IDE was complaining at me about it not being [[nodiscard]].
Okay, well you will have to do everything that scons does for build commands.
Obviously the binding mechanism isn’t being built correctly. Unfortunately I don’t know a lot about Godot’s binding implementation. (I will peak at it)
The only thing in the console, or show by my IDE is: Exception: Exception 0xc0000409 encountered at address 0x7ffbd36211d5
No error messages or anything like that. If you think it would be helpful I can clean up the project a bit and push it to GitHub. But by your own submission if there’s nothing syntactical wrong with the project or how it’s built then maybe not that useful
Sure, I mean superficially the code all looks good. But just a vague error like that and the fact your are running your own build script makes me suspect it’s a build issue.
I guess doing a search on the vague error I get mentions of an unhandled thrown exception. But I’m not aware that Godot uses any try/catch/throw behavior off the top of my head.
Maybe looking to see if that address points to a function could be useful
Btw I’m looking at the template, and it says it works with 4.2. and looking at the git history there have been changes to the binding script between 4.2 and 4.3. so it could be possible that the template used is not compatible with 4.3.
There is also an example project in the template, you could try that with 4.3 to see if it is a template issue.
I had a look at the godot_cpp Sconstruct file and didn’t see anything that immediately stood out as something bespoke that needs porting to CMake. I will also check the original template works with 4.3 like you suggest
so it could be possible that the template used is not compatible with 4.3.
Okay, so I think you are right with this. I just built the original template’s extension using the godot-4.3-stable branch in godot-cpp and tried to load it into a Godot application and got an error with the _bind_methods function. I think maybe work asking on the godot-cpp repo at this point?
Um, I don’t think so. I’m pretty sure it works. I recently helped someone setup an audio plugin with gdextension on 4.3 using the default build system.
I think you may want to ask the template creator to take a look.
I found the answer, it was due to the differences between FetchContent and ExternalProject. So it wasn’t actually applying the double precision flag, but also not warning it wasn’t doing it. So it was trying to load a single precision extension into a double precision godot instance.
Fixed the FetchContent issue and rebuilt and works fine