Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
E

EricP 1234

@EricP 1234
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help with inheritance
    E EricP 1234

    Hi Sirrius, The problem was very well described by Ryan. The solution to fix your compilation error is to delete both #include statements. Here is an example of a simple yet correct way to include header files like your are trying to do: File ClassA.h:

    #ifndef CLASSA_H
    #define CLASSA_H
    #include "ClassB.h" // <- Remove this line
    #include "ClassA.h" // <- Remove this line
    class a
    { ... };
    #endif

    File ClassB.h:

    #ifndef CLASSB_H
    #define CLASSB_H
    #include "ClassA.h" // Include definition of base class.
    class b : public a
    { ... };
    #endif

    If you want to derive other classes from concAbstFactory then simply include "concAbstFactory.h" in the header files for those new derived classes. Your base classes should not have any knowledge of your derived classes. Hope this helps. :) Eric

    C / C++ / MFC help oop
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups