Vector2D tankPos = Tank_b017191c::GetTankPosition();
I am trying to call a function from a different class but I am getting this error:
47 IntelliSense: a nonstatic member reference must be relative to a specific object e:\Repos\GameAI\GameAI\PathFinder_b017191c.cpp 113 21 GameAI
I have included Tank_b017191c.h in my header file but not getting very far..
It seems that member function GetTankPosition
is a non-static member function. You have to call it with using an instance of the class as for example
Tank_b017191c tank;
Vector2D tankPos = tank.GetTankPosition();
or
Tank_b017191c tank( /* some arguments */ );
Vector2D tankPos = tank.GetTankPosition();
You need to have something like this:
Tank_b017191c tank; // you first need to create an object of this class
Vector2D tankPos = tank.GetTankPosition();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With