Thursday, December 30, 2010

unresolved overloaded function type

error: no matching function for call to class1::input(void*, unresolved overloaded function type)
note: candidates are: int class1::input(void*, int (class1::*)(void*, int))

if your function call is like
input( (void*)&cur_msg, class1::input);

change it to
input( (void*)&cur_msg, &class1::input);

Its basically a function pointer, so you need to pass address of that function

Tuesday, December 28, 2010

error: TIOCFLUSH was not declared in this scope

include "sys/ioctl.h" on Linux, change TIOCFLUSH to TCFLSH in ioctl call

error: expected constructor, destructor, or type conversion before & token

If you get the following error
"error: expected constructor, destructor, or type conversion before & token"
or
"error: expected initializer before & token"

Add "std::" before the token, if token is part of std namespace.
like std::ostream.
You can also think of adding "using namespace std;" in your source file but Please don't add using line in your header file.

Thursday, December 23, 2010

error: extra qualification on member

If you get the above error, just remove the extra scope resolution operator,:: and it should work fine.

Monday, December 20, 2010

error: ostrstream was not declared in this scope

If you get such errors
"error: ostrstream was not declared in this scope"

try to include its relevant header file and/or namespace.

For this error, include or along with using namespace std;