Writing Compile-time Independent Code

Discussion in 'C++' started by Scott Brady Drummonds, Jul 23, 2003.

  1. Hi, everyone,

    I'm working on a software project that contains some C++ code that I would
    like to be common to two separate projects. Ideally, I'd like to have each
    of these separate projects conditionally compile and link the common code
    per environment configuration. However, I feel that the very nature of this
    common code (that it is mutually compile- and link-time dependent with the
    software projects) precludes this type of setup. As such, I think that the
    solution may fall into the realm of programming instead of build environment
    configuration.

    In an independent discussion I've been having in a build environment mailing
    list, someone mentioned that I should investigate a plugin type architecture
    for this solution. I believe the implication here is that stub header files
    are provided, perhaps in conjunction with dummy libraries, that serve as
    interfaces to real libraries that might be statically or dynamically linked
    later, or even executed as a separate process. However, I'm not quite
    certain.

    Can anyone recommend a book, webpage, or example code that would show me how
    I can break physical dependencies in logically dependent C++ code? I've
    enjoyed some of the techniques in the John Lakos book
    (_Large_Scale_C++_Programming_, I belive) but think that I need another
    physical-minded C++ design book to help me out.

    Thank you for your help!
    Scott

    --
    Remove ".nospam" from the user ID in my e-mail to reply via e-mail.
     
    Scott Brady Drummonds, Jul 23, 2003
    #1
    1. Advertising

  2. "Scott Brady Drummonds" <> wrote in message news:<bfn2tf$nt2$>...

    there are bits of your post I didn't quite follow.

    > I'm working on a software project that contains some C++ code that I would
    > like to be common to two separate projects.


    sounds straight forward. Make the common code into a library
    (or libraries). Suppose project-A has a big lump of code to manage say,
    sockets. And you now need project-B to also manage sockets. Create a socket
    library from the project-A code. Compile and link it with the two
    projects.

    > Ideally, I'd like to have each
    > of these separate projects conditionally compile and link the common code
    > per environment configuration.


    not sure where the conditional compilation came from. I've sometimes
    found it hard to manage. I think I need to know more about what you're
    trying to do.

    > [...] However, I feel that the very nature of this
    > common code (that it is mutually compile- and link-time dependent with the
    > software projects) precludes this type of setup.


    lost me.


    > [...] As such, I think that the
    > solution may fall into the realm of programming instead of build environment
    > configuration.


    ?


    > In an independent discussion I've been having in a build environment mailing
    > list, someone mentioned that I should investigate a plugin type architecture
    > for this solution. I believe the implication here is that stub header files
    > are provided, perhaps in conjunction with dummy libraries, that serve as
    > interfaces to real libraries that might be statically or dynamically linked
    > later, or even executed as a separate process. However, I'm not quite
    > certain.


    ask the person who sugested this

    <snip>


    --
    Nick Keighley
     
    Nick Keighley, Jul 24, 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. Patrick Ma
    Replies:
    3
    Views:
    517
    Dave Monroe
    Jun 19, 2004
  2. flamesrock
    Replies:
    8
    Views:
    553
    Hendrik van Rooyen
    Nov 24, 2006
  3. Nagaraj
    Replies:
    1
    Views:
    920
    Lionel B
    Mar 1, 2007
  4. Carter
    Replies:
    2
    Views:
    530
    Carter
    Mar 4, 2009
  5. fAnSKyer
    Replies:
    2
    Views:
    569
    Alf P. Steinbach
    Jun 7, 2009
Loading...

Share This Page