If possible, how to correctly inherit a GDNative class, or use Interface

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DelightLlama

Am creating multiple GDNative modules, each module makes use of a different web API, but is taking me a lot of time by going back and forward between the projects of a single Visual Studio solution, confirming that the function names and arguments match, so in my Godot project the calls are the same regardless of the .dll loaded.

Using this example code:
Library.cpp

#include "GDBase.h

using namespace godot;

extern "C" void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options *o) {
	Godot::gdnative_init(o);
}

extern "C" void GDN_EXPORT godot_gdnative_terminate(godot_gdnative_terminate_options *o) {
	Godot::gdnative_terminate(o);
}

extern "C" void GDN_EXPORT godot_nativescript_init(void *handle) {
	Godot::nativescript_init(handle);
	register_class<godot::GDBase>();
}

GDBase.h:

#ifndef GD_BASE_H
#define GD_BASE_H

#include <Godot.hpp>
#include <Node.hpp>

namespace godot {

class GDBase : public Node {
	GODOT_CLASS(GDBase, Node)

public:
	static void _register_methods();

	GDBase();
	~GDBase();

	void _init(); // our initializer called by Godot

	virtual String get_api_name();
};

}

#endif

GDBase.cpp:

#include "GDBase.h"

using namespace godot;

void GDBase::_register_methods() {
	register_method("get_api_name", &GDBase:get_api_name);
}

GDBase::GDBase() {
}

GDBase::~GDBase() {
	// cleanup here
}

void GDBase::_init() {
	// initialize variables
}

String GDBase::get_api_name() {
       return "Base";
}

Lets say I want o inherit GDBase, to GDClassA and GDClassB, and override get_api_name, I’ve tried:
inheritance of class GDBase to GDClassA but GODOT_CLASS(GDClassA, GDBase) isn’t recognized as a Godot class; Interfaces with abstract class, but inheritance isn’t allowed (according to Visual Studio)

What is the correct way to inherit GDBase, if is even possible.

Thanks.

:bust_in_silhouette: Reply From: sash-rc

As comments of GODOT_CLASS registration macro says, you should use Godot’s (ultimate predecessor) class, Node in your case, not GDBase.

GODOT_CLASS(GDClassA, Node)