Umm so I ran into this weird problem today.
It's probably my own ignorance but I wanted to know why this happens
and if it's supposed to.
Say I have this code:
(Using MinGW/GCC 4.5 compiler on Windows)
Code:
class Bar
{
protected:
// ctor/dtor
ssize_t Write(const void* buffer, size_t bytes);
};
class Foo : public Bar
{
public:
// ctors etc.
// ...
void Write(int8_t value);
};
void Foo::Write(int8_t value)
{
// UH OH
// Compiler complains that there is no "matching function call to
// Foo::Write(void*, unsinged int)"
Write(&value, sizeof(value));
}
So what is going on here?
It appears that the compiler "knows" that there is a Write() method
that takes two arguments, but for some reason it can't look it up.
Now if I say:
Code:
void Foo::Write(int8_t value)
{
Bar::Write(&value, sizeof(value));
}
that sort of works until we get to the link stage...