Compilation error when base and derived classes defined in separate namespaces
<p>I have defined base class and derived class in separate namepsaces(This is a requirement as several classes can be derived from a single base class and based on behaviour of derived classes they are to be place din separate namespaces.)</p>

<pre><code>Base.h

namespace global
{

    {
    class Base
    {
    public:
        Base();
        virtual ~Base();    

        virtual int someFunc(int arg1);
    }
}

Derived.h

namespace global
{
    namespace derived
    {

    class Derived: public Base()
    {
    public:
        Derived();
        ~Derived();
    }   
    }
}

Derived.cpp

namespace global
{
    namespace derived
    {
    Derived::Derived() {}
    Derived::~Derived() {}

    int Derived::someFunc(int arg1)
    {
    //some code here
    }
    }
}
</code></pre>

<p>When I try to compile this code, I get the error:</p>

<p><strong>no 'int global::derived::Derived::someFunc(int arg1)' member function declared in class global::derived::Derived.</strong></p>

<p>So, do I need to declare someFunc in Derived again?</p>

<p>like:</p>

<pre><code>namespace global
{
    namespace derived
    {

    class Derived: public Base()
    {
    public:
        Derived();
        ~Derived();
        int someFunc(arg1 int);
    }   
    }
}
</code></pre>

<p>Now, if there is some Function in a totally separate namespace, that accepts base class reference, how can I pass it derived class reference?</p>

<pre><code>tryFunc(Base &amp;b);

Derived d;
tryFunc(d);
</code></pre>

<p>Is this correct?</p>

<p>Thanks.</p>
