Results 1 to 3 of 3

Thread: Redefinition Problem

  1. #1
    Join Date
    Jun 2011
    Posts
    203
    Thanks
    7
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Redefinition Problem

    Hi Guys,

    I'm inheriting a class as below:

    class ClassA : public ClassBase

    However, to do so, I need to include "ClassBase" but when I compile it, I get a redefinition error. Bit of a catch 22 don't you think? P.S. I've used header guards.
    Last edited by Atomic_Sheep; 25th August 2013 at 13:53.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Redefinition Problem

    Show us the actual code please.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2011
    Posts
    203
    Thanks
    7
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Redefinition Problem

    Managed to get it to work as I was writing this up, had a circular include, one in the parent for the base and one in the base for the parent, all seems fixed now.

Similar Threads

  1. How can i prevent class redefinition problem ?
    By ankurjain in forum General Programming
    Replies: 5
    Last Post: 26th May 2006, 02:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.