From: Karsten <kl...@rh...> - 2001-03-18 13:41:02
|
Rakshasa schrieb: > > Twice i've had problems with using classes in shepherd, once with > Pan::EntityAccessor, and once with the Matrix3D. The first one magically > disappared, the second one gave me a limited insight into the problem. > > It seems that if you want to use a class implemnted in one of the *.a > file, in one of the *.a files. Then the class must be initialised in > atleast one of the *.o files. This problem doesn't show up until you try > to use a class implemented in a *.a file that uses an affected class. > > Hope this makes sense;) > I ran across the same problem several times. It is the linker which does cause this, as it only copies those parts of code from the libraries into the final binary which gets actually called from his point of view. And the linker will constantly do this wrong in our sense, if you only call the baseclass' methods from the main program, which is common and good practice in OO design. So the linker "sees" no calls to any derived classes and omits their code in the final link. The only solution which I have found so far is to link all libraries dynamically, because .so files are always completely loaded into memory and thus our wanted code is there :) I guess, but I am not sure, that there must be a linker option so that it does not throw away any code but simply copies the library completely into the final binary. I hope this helps (a bit). -- Karsten-O. Laux kl...@rh... _______________________________________________ Server mailing list Se...@ma... http://mail.worldforge.org/lists/listinfo/server |