How to extend a C++ base class from a shared library
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > How to extend a C++ base class from a shared library




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How to extend a C++ base class from a shared library  
j_mckitrick@bigfoot.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-23-05 01:49 AM

I have a handful of components that share a great deal of
functionality.  In Win32, we kept a source library, and derived new
classes from the base class by linking the base class in at the source
level.

Now that we are porting to Unix, I'd like to compile the base class,
install it as a shared library, and derive from it.

How can I do this?  The compiler doesn't seem to see the base class in
the shared library when I try to link it into a new class that will
extend it.  Is there a special command line option or something I need
to do in the header file to make this work?

jonathon






[ Post a follow-up to this message ]



    Re: How to extend a C++ base class from a shared library  
Paul Pluzhnikov


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-23-05 12:54 PM

j_mckitrick@bigfoot.com writes:

> The compiler doesn't seem to see the base class in
> the shared library when I try to link it into a new class that will
> extend it.

I can't parse your sentence above in any meaningful way.

Try creating a simple example showing what your code is, what
command lines you used to compile and link it, and what error was
produced while doing so.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.





[ Post a follow-up to this message ]



    Re: How to extend a C++ base class from a shared library  
j_mckitrick@bigfoot.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-23-05 11:01 PM

Ah, I got it.  I got a simple example working, so that made me check
out my makefiles.  It turns out I need to add a dependency for the base
class.

Now I have CBaseClass compiled into one shared library, and another
shared library can include BaseClass.h and derive a new class that
extends it.

Thanks for your help!






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:22 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register