O
Olaf Martens
Greetings!
Here's another problem that appeared recently:
I have the following function call:
l_test->Compress(&"filename.dat",l_buf);
l_test is a pointer-to-packer that I want to check here.
The file name thing should be plain enough, whereas l_buf is declared as a
char * and contains a pointer to a data buffer.
Compress() itself has the following declaration:
Compressor_Base : public Base
{
..
..
..
public:
void Compress(const char *p_name, void *p_buf);
}
p_name takes the name of a file that is to contain the (compressed) data, and
p_buf is a pointer-to-buffer, whose contents are to be compressed (the buffer
can contain any data type, and is of no relevance for the function).
l_test is declared as type Compressor_Base and should therefore correctly
reference the function Compress().
But when compiling the source I get the following error:
main.cpp:609: error: no matching function for call to `Compressor_Null::
Compress(const char (*)[31], char*&)'
compressor_base.h:88: error: candidates are: void
Compressor_Base::Compress(const char*, void*)
So, what's going on here?
I don't remember having included a *reference* to l_buf, and even prepending
(void *) to l_buf won't help.
Did I miss some peculiarities of void pointers, or is this some sort of bug?
Switching p_buf from void * to, for example, char * doesn't help, either - the
same type of error appears every time I attempt a compilation.
Any help would be appreciated.
Here's another problem that appeared recently:
I have the following function call:
l_test->Compress(&"filename.dat",l_buf);
l_test is a pointer-to-packer that I want to check here.
The file name thing should be plain enough, whereas l_buf is declared as a
char * and contains a pointer to a data buffer.
Compress() itself has the following declaration:
Compressor_Base : public Base
{
..
..
..
public:
void Compress(const char *p_name, void *p_buf);
}
p_name takes the name of a file that is to contain the (compressed) data, and
p_buf is a pointer-to-buffer, whose contents are to be compressed (the buffer
can contain any data type, and is of no relevance for the function).
l_test is declared as type Compressor_Base and should therefore correctly
reference the function Compress().
But when compiling the source I get the following error:
main.cpp:609: error: no matching function for call to `Compressor_Null::
Compress(const char (*)[31], char*&)'
compressor_base.h:88: error: candidates are: void
Compressor_Base::Compress(const char*, void*)
So, what's going on here?
I don't remember having included a *reference* to l_buf, and even prepending
(void *) to l_buf won't help.
Did I miss some peculiarities of void pointers, or is this some sort of bug?
Switching p_buf from void * to, for example, char * doesn't help, either - the
same type of error appears every time I attempt a compilation.
Any help would be appreciated.