Hey everyone. I'm having some problems:
The above code compiles properly, but if I add the keyword inline to either the prototype or definition, I end up with an unresolved external pertaining to "int __thiscall Socket::recv(char *,int)". However, if I simply 'inline' the function by putting the definition in the class definition and eliminating the prototype, then I have no errors. The only place Socket::recv() is being called, is here:
(in Socket class definition)
int Socket::recv(char* buf, int len);
(in separate .cpp)
int Socket::recv(char* buf, int len)
assert(buf != NULL);
return ::recv(si->desc, buf, len, 0);
If it makes any difference, readCallback() is being called via a function pointer contained within the Socket object being passed to it.
void readCallback(Socket s, int err)
int res = s.recv(buf, 200);
if(res == SOCKET_ERROR)
buf[res] = '\0';
log << buf << std::endl;
Is this a compiler bug (happens both with MSVC 2005 Express Beta 2 and MSVC 6.0 Pro), or is there something I'm doing genuinely wrong?