Error: there is no corresponding function to call

I want to use the anothre class method in another, but I get the error below, what is the problem? TIA

error: there is no corresponding function to call in "PositionInfo" :: PositionInfo ()

here is my code:

PositionInfo Pos;

double metr=Pos.GetBallDistToTeammate(5);

and PositionInfo.h class:

PositionInfo(WorldState *pWorldState, InfoState *pInfoState);

and PositionInfo.cpp class:

const double & GetBallDistToTeammate(Unum unum) const { Assert(unum > 0); return GetBallDistToPlayer(unum); }
+3
source share
2 answers

The default constructor is PositionInfo::PositionInfo() { /* code */}missing from your cpp file.

+2
source

error: there is no corresponding function to call in "PositionInfo" :: PositionInfo ()

It seems that someone is trying to call the default constructor for the class, but the compiler cannot find it.

+2
source

All Articles