compilation dependencies ..

Discussion in 'C++' started by Anand, Jul 8, 2003.

  1. Anand

    Anand Guest

    I've a singleton object declaration in C++ in which there are other
    classes' POINTERS declared as private members as shown below.

    // CSingleton.h

    Class Singleton
    {

    private:
    CObject1 *obj1; // defined inCObject1.h
    CObject2 *obj2; // defined in CObject2.h
    Cobject3 *obj3; // defined in CObject3.h
    }
    I'm on a HP-UX, and in one of the cpp files the Singleton object is
    created(CSingleton.h). If one of the objects viz., CObject ; CObject2
    ;
    CObject3 changes (ie., a change in the header)will i have to recompile
    the cpp file.?? As of now, I recompile the cpp before execution.
    Incase if I choose not to recompile the cpp file, will it cause any
    future errors which might go undetected during compilation??

    Regards
    Anand
    Anand, Jul 8, 2003
    #1
    1. Advertising

  2. "Anand" <> wrote...
    > I've a singleton object declaration


    ....you mean "definition"...

    > in C++ in which there are other
    > classes' POINTERS declared as private members as shown below.
    >
    > // CSingleton.h
    >
    > Class Singleton
    > {
    >
    > private:
    > CObject1 *obj1; // defined inCObject1.h
    > CObject2 *obj2; // defined in CObject2.h
    > Cobject3 *obj3; // defined in CObject3.h
    > }

    ;

    > I'm on a HP-UX, and in one of the cpp files the Singleton object is
    > created(CSingleton.h).


    One of the cpp files is an .h file? I am not sure I understand.

    > If one of the objects viz., CObject ; CObject2
    > ;
    > CObject3 changes (ie., a change in the header)will i have to recompile
    > the cpp file.??


    It depends on whether you use the CObject3 class in it or not.
    Usually, if 'obj3' is obtained from 'new' (that is, CObject3
    is instantiated), you will need to recompile. If you obtain
    your 'obj3' pointer from other function, there may not be a need
    to recompile.

    > As of now, I recompile the cpp before execution.


    That's a safe approach.

    > Incase if I choose not to recompile the cpp file, will it cause any
    > future errors which might go undetected during compilation??


    It is impossible to tell. My crystal ball is not working today.

    Victor
    Victor Bazarov, Jul 8, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric DELAGE
    Replies:
    2
    Views:
    662
  2. =?ISO-8859-1?Q?Michael_B=F8cker-Larsen?=

    File or assembly name System, or one of its dependencies, was notfound.

    =?ISO-8859-1?Q?Michael_B=F8cker-Larsen?=, Jul 2, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    3,136
    Marcus Nilsson
    Jul 10, 2003
  3. Philipp Schumann
    Replies:
    2
    Views:
    1,372
  4. D.C.
    Replies:
    0
    Views:
    647
  5. C__chp
    Replies:
    4
    Views:
    492
    Puppet_Sock
    Feb 15, 2008
Loading...

Share This Page