When I do that, I get an error that says this: "name followed by '::' must be a class or namespace name."
Which is weird, because it is a class name.
Edit: Turns out I just forgot to include the ResourceLoader
header. However, I'm still having some issues. So I guess I should elaborate a little more on how I have my code set up:
In a header file, I have a variable declared, like this:
Object thing
(am I supposed to change the Object
to a (Ref<[Object]>)
?)
And in the _init
function of a cpp file, I need to set it.
So when I just do this:
thing = ResourceLoader::get_singleton()->load("path");
I get an error, saying the operand types are invalid, as makes sense. So the obvious reason for this is that I didn't include the (Ref<[Type]>)
. But where am I supposed to include it? You said to prepend it, but prepend it where? Do I have to do it in the declaration like I said earlier? Do I have to put it before the variable initialization, like (Ref<[Object]>) thing = ResourceLoader::get_singleton()->load("path");
? Am I supposed to put it inside the load()
? I'm a little confused.