CPP with dynamic lib

Discussion in 'C++' started by Paras Sharma, Jul 29, 2003.

  1. Paras Sharma

    Paras Sharma Guest

    Hi

    One question regarding CPP w.r.t dynamic libary .

    I can understand w.r.t C where get the handle and call the function
    using function ptr.
    How to use CPP virtual funcitons when we are using dynamic library.

    Bacically .
    1 How to organise two drived classes in dynamic library . where to
    place base class
    2 How to create instance of derived class ,Like user if specify first
    library ( from cmd line a.out libd1.so ) , D1 should be instancitated
    and so on.


    Class B {
    ....
    virtual foo() =0 ;
    virtual foo1() {...} ;
    }

    Class D1 {
    ....
    foo() {...} ;
    foo1() {..} ;
    }


    Class B {
    ....
    foo() {...};
    foo1(){...} ;
    }


    main () { // With Respect to C how to get CPP

    handle = dlopen
    fnctPTR = dlsym(handle..)
    ....

    }


    Any pointers will be helpful

    Thanks
    Paras
    Paras Sharma, Jul 29, 2003
    #1
    1. Advertising

  2. Paras Sharma

    Jack Klein Guest

    On Tue, 29 Jul 2003 08:45:07 +0530, Paras Sharma <>
    wrote in comp.lang.c++:

    > Hi
    >
    > One question regarding CPP w.r.t dynamic libary .


    [snip]

    All libraries are either compiler or operating system specific, and
    not defined by the language. You need to ask this question in a
    support group for your particular compiler/operating system
    combination. It is not a language issue.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c /faq
    Jack Klein, Jul 29, 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. DrUg13
    Replies:
    1
    Views:
    469
    DrUg13
    Feb 10, 2004
  2. Alex Vinokur
    Replies:
    7
    Views:
    404
    Greg Comeau
    Nov 15, 2004
  3. Vinu
    Replies:
    9
    Views:
    616
  4. Alf P. Steinbach /Usenet
    Replies:
    10
    Views:
    602
    sturlamolden
    Jul 13, 2010
  5. Alf P. Steinbach /Usenet
    Replies:
    17
    Views:
    452
    Alf P. Steinbach /Usenet
    Jul 14, 2010
Loading...

Share This Page