Hi,
I am trying to write a function but keep getting an error when I try to build. I'm not very experienced with c++ so I can't really figure out what the error means. The funcion is called like this:
Code:
nMarkerCount = netClient.GetMarkerCount();
and it looks like this:
Code:
int BMLClient::GetMarkerCount(void)
{
if (!m_bConnected) return 0; //??
long cmd = 3;
if (!Send(&cmd, sizeof(cmd)))
{
std::cout << "Unable to send <get marker data> command" << std::endl;
return false;
}
long count;
if (!Recv(&count,sizeof(count)))
{
std::cout << "Unable to get marker count" << std::endl;
return false;
}
m_nMarkerCount = count;
m_buffer = new double[count*3];
m_bConnected = true;
return m_nMarkerCount;
}
I have declared it as public in the header file like this:
Code:
int GetMarkerCount(void);
The error that I get says: error C2662: 'BMLClient::GetMarkerCount' : cannot convert 'this' pointer from 'const BMLClient' to 'BMLClient &'
Can anyone tell from what I've posted what this error means? Thanks!