help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what is this error?


From: Jan van Mastbergen
Subject: Re: what is this error?
Date: Tue, 2 Nov 2004 22:43:04 +0100

Isn't your error simply in the parameters to the constructor call TMO():
NProcessor("TMO", 1) {}?
Your providing a string literal, so basically its type is char*. I don't
know what a QString is but make sure its compatible with a char *.

HTH, Jan

"Gav Wood" <gav@cs.york.ac.uk> wrote in message
news:cm8ah6$m8p$1@pump1.york.ac.uk...
> hi all,
>
> i'm trying to compile (fairly simple) code that uses inheritance:
>
> it looks like this:
>
> namespace geddei {
>         class Processor: ...
>         {
>                 Processor(const QString &type): ... {}
>         };
> }
>
> class NProcessor: virtual public geddei::Processor, ...
> {
>         NProcessor(const QString &type, int a): Processor(type), ... {}
> };
>
> class TMO: public NProcessor
> {
>         TMO(): NProcessor("TMO", 1) {}
> };
>
> the error i'm getting is:
>
> /home/gav/Projects/geddei/src/tests/testmulti.cpp:388: error: no matching
> function for call to `geddei::Processor::Processor(const <anonymous>**)'
> /home/gav/Projects/geddei/src/geddei/processor.h:112: error: candidates
are:
> geddei::Processor::Processor(const geddei::Processor&)
> /home/gav/Projects/geddei/src/geddei/processor.h:561: error:
> geddei::Processor::Processor(const QString&)
>
> the error points to the TMO constructor line: if i comment out the class
> TMO, it compiles fine. i dont see why this is, since TMO doesn't
(directly)
> refer to Processor.
>
> i also have no idea where the "const <anonymous>**" is coming from.
>
> could it be something to do with my virtual inheritance?
>
> any other ideas?
>
> gav
>
> -- 
> York





reply via email to

[Prev in Thread] Current Thread [Next in Thread]