I'm working on Windows, in C++ with Visual Studio.
I have a class that has a:
enum algorithmStatus { LOADING, DETECTION, TRACKING, LOST };
In the declaration I want to use a setter and getter to change the status, something like:
void MyStatusClass::setAlgorithmStatus(algorithmStatus newStatus)
{
//_Status = newStatus;
//_Status = MyStatusClass::algorithmStatus::LOADING;
}
But I can't compile because I get:
Error 5 error C2511: 'void MyStatusClass::setAlgorithmStatus(MyStatusClass::algorithmStatus)' : overloaded member function not found in 'Nft_Status' c:\MyStatusClass.cpp 197
How can I do that setter correctly?
EDIT:
In header is already declarated:
void setAlgorithmStatus(MyStatusClass::algorithmStatus newStatus);
and:
void setAlgorithmStatus(algorithmStatus newStatus);
In cpp the function is declared just i write on top.
SOLVED
The problem was i used a MyStatusClass::algorithmStatus in the constructor, you don´t need to use the MyStatusClass::, and its advisable don´t use it if you don´t need it.
setAlgorithmStatusin your class. Or you declared that function in a wrong way. The function declaration should look something like this -void setAlgorithmStatus(MyStatusClass::algorithmStatus my_variable);_Sis a prefixed reserved to the implementation.