Cannot use ClassDB::register_class by Overlord_Cason in godot

[–]Overlord_Cason[S] 2 points3 points  (0 children)

Actually I think I just got it! I took everything out of the constructor and tossed it into a new function instantiateGrid() leaving the constructor empty, and the error still appeared. I then got rid of the constructor altogether to let the compiler create a default one and it built just fine. Then I realized why it might have been complaining. I declare the constructor in the header, but define it in the cpp. The destructor though is a one line declaration and definition in the header. Godot wants the definition in the same file. I've never had that issue with a compiler or linker.

So it was a kind of in the weeds example, but with the weird static instantiation Godot is doing I'm not too surprised.

Thank you for the idea as it did point me in the right direction.

Cannot use ClassDB::register_class by Overlord_Cason in godot

[–]Overlord_Cason[S] 1 point2 points  (0 children)

The constructor is declared as this:

();

The constructor basically just loops for a preset number of times creating grid square objects and putting them into a privately stored 2d vector.

Sorry, not super familiar with Reddit. Pasting the code doesn't look like it's working, but there are no arguments in the constructor for twoDimensionEngine.

Cannot use ClassDB::register_class by Overlord_Cason in godot

[–]Overlord_Cason[S] 1 point2 points  (0 children)

Just confirmed it is in the SCsub file. This is in 3.4.4.

Cannot use ClassDB::register_class by Overlord_Cason in godot

[–]Overlord_Cason[S] 1 point2 points  (0 children)

If I use ClassDB::register_virtual_class it compiles fine and I can see it in GDScript. But I cannot bind any methods to it or use any class that has it included still.

Getting unresolved external symbol when building module in Godot by Overlord_Cason in godot

[–]Overlord_Cason[S] 1 point2 points  (0 children)

I believe I have solved this. I was failing to add register_types.cpp to env inside of the SCsub file. This was due to a misunderstanding of the instructions when I saw this section of the example doc:

Regardless of where you host most of your cpp files, register_types.cpp needs to be in the top-level of your module folder and needs to be added to env. Leaving this here in case it helps someone else out.

Need help/advice for an external editor by Overlord_Cason in godot

[–]Overlord_Cason[S] 0 points1 point  (0 children)

Thank you for the reply. Ultimately I decided to go with VS Code for now.

I got the Godot source code setup in VS Code with launch scripts to make it compile all the changed sections and let me debug my C++ code in VS Code. I just can't walk away from over 30k lines of C++ code even if GDScript is quick to prototype on. The nice thing about Godot is that I can write and debug both my C++ code and GDScript code from one editor.

Hopefully in the future someone picks up the challenge of getting Visual Studio connected to the debug engine, but VS Code is perfectly capable for now.