Re: shared library - undefined symbols

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Anitha Boyapati writes:
 > 
 > On Wed, 6 Dec 2006, Andrew Haley wrote:
 > 
 > > Anitha Boyapati writes:
 > >  > 
 > >  >  Please let me know if I am missing something.It is important for
 > >  >  me to get through this immediately :-(
 > >  > 
 > >  >  -------------------------------------------
 > >  > 
 > >  >  Sample Code :
 > >  > 
 > >  > 	class X : class baseX {
 > >  > 	...
 > >  > 	};
 > >  > 
 > >  > 	class Y : class baseY {
 > >  > 	...
 > >  > 	};
 > >  > //End of Code
 > >  > 
 > >  >  g++ -c -shared -o mem.so X.o Y.o
 > >  > 
 > >  >  ( This created mem.so )
 > >  > 
 > >  >  When used with dlopen as :
 > >  > 
 > >  >  handle = dlopen ("mem.so", RTLD_LAZY)
 > >  >  
 > >  >  The above statement throws error saying undefined reference to baseX
 > >  >  and BaseY!	
 > > 
 > > No kidding.  Where are baseX and BaseY defined?
 > 
 >  They are also included while building mem.so.But I got the mistake.
 >  I didnt define the virtual methods declared in X and Y out of pure 
 >  ignorance :-)
 > 
 >  Doesnt it sound right if we have some error or warning thrown for such 
 >  cases where definitions are not found while building a shared library?

Why?  They might be defined in some other library.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux