compiler warning

06 Nov 2010

Hello, I'm getting a warning which I can't seem to get rid of.  For this constructor

 

TestClass::TestClass(PinName one, PinName two, PinName three, PinName four);
        

I get the same warning twice stating that  "Qualified name is not allowed in member declaration". What confuses me is that the warning disappears after a recompilation. Anybody knows whats going on.??

06 Nov 2010

Hi Dimiter,

You just need to remove the "TestClass::" part.

It comes down to how you declare and define methods. You can either define the member function when you declare it (usually in the .h file):

class Foo {
public:
    Foo() { ...implementation... }    
};

or separately, usually with the decleration in a .h file, and definition/implementation in a .cpp file:

class Foo {
public:
    Foo();
};

Foo::Foo() { ...implementation... }
I think you've just mixed the two.

Simon

06 Nov 2010

Hi Simon , thanks that fixed it. I thought I tried everything.

Dimiter