class implementing class in same namespace

This is a discussion on class implementing class in same namespace within the C++ Programming forums, part of the General Programming Boards category; Hello there, I'm currently working on a GUI system for OGL but somehow I got stuck along the way. I'm ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    10

    class implementing class in same namespace

    Hello there,

    I'm currently working on a GUI system for OGL but somehow I got stuck along the way.

    I'm splitting my code up into multiple namespaces, just to keep it organised.
    Now I have a namespace Gui::Controls, in which I will define all my controls.
    In this namespace I have my base class Control, which I need to implement in all my other controls.

    This is my declaration of the Gui::Controls::Control class:
    PHP Code:
    namespace Gui{
        namespace 
    Controls{
            class 
    Control : public Object{
                    ....
                    };
            };
    }; 
    And this is my declaration of the Button control, which needs to implement Gui::Controls::Control:
    PHP Code:
    namespace Gui{
        namespace 
    Controls{
            class 
    Button: public Control{
                    ....
                    };
            };
    }; 
    (Gui::Controls::Control resides in control.h, and Gui::Controls::Button resides in button.h.
    button.h is including control.h.)

    Now this doesn't seem to work as i get the following error:
    Code:
    error C2504: 'Control' : base class undefined
    Any ideas how to solve this?

    Grtz, Tom.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    Mar 2009
    Posts
    10
    Never mind, I found out what I did wrong..
    I forgot to add some closing tags to my namespaces causing them to get messed up.

    Grtz, Tom.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 10-02-2005, 12:27 AM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  3. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  4. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 06:18 AM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 01:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21