Hi nice idee,
but it doesn't work.
If you have somethinge like

void WorkClass::testfunction(void)
{
        static TestClass tc;
......
}

in a Kernelmodule an you try to insmod this you get an 
unresolved symbol atexit() ....
So you need somethinge like Erwin Rol write, but I don't solved the problem
to use the destroctor from TestClass as a memberfunctionpointer !!

Could anybody write a short example how I can set the destructor to a
memberfunctionpointer and use this pointer to destroy the static TestClass
??
Thanks 
 Michael

> -----Original Message-----
> From: Jan Albiez [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 6:37 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: [rtl] sqrt implementation? (not the same old question
> ;-) )
> 
> Hoi !
> 
> On Fri, Feb 15, 2002 at 04:30:49PM +0100, Back Michael (extern) wrote:
> > have you a short sample code ?
> > I am unable to set the destructor of a Object to a memberfunctionpointer
> !!
> > And additional I am unable to execute the memberfunctionpointer to
> > destroy the static Object.
> 
> Have a look at the C++ example in the rtlinux distribution. What yoe
> REALLY
> have to do with c++ is:
> 
>  int init_module(void)
>  {
>    __do_global_ctors_aux(); 
>  
>    ...
>  }
> 
>  void cleanup_module(void)
>  {
>       
>    ...
>  
>    __do_global_dtors_aux();
>  };
> 
> This should initialize your static classes (unless you don't forget to
> link
> the CRTs).
> 
> > > >         I'm trying to use the sqrt function in my C++ realtime
> module,
> > > but I get the
> > > > "unresolved symbol sqrt". I make the linkage as I saw in old
> postings:
> > > > 
> > > > $(LD) -r -static -L/usr/lib -lm -lc -o app.o $(CRTBEGIN) rtmodule.or
> > > > tmatrix.o $(CRTEND)
> > > > 
> > > >         I use extern "C" for includes too.
> > > >         I guess this has to do with the specific problems of C++
> > > realtime code, the
> > > > same that prevented me from using POSIX I/O. So probably the easiest
> > > solution
> > > > will be to use my own sqrt. Does anybody know any implementation
> that I
> > > could
> > > > use or easily port?. Thank you.
> 
> http://sourceforge.net/projects/mca2/
> 
> look for the rt_math module there.
> 
> blue skies
>       Jan
> 
> -- 
> -- Jan Christian Albiez -- IDS Interactive Diagnosis- and Servicesystems
> --   
> -- FZI -- Haid-und-Neu-Str. 10-14 -- 76131 Karlsruhe -- +49 721 9654 206
> --
> -- segmentation violation in module reality.o ...
>                             ... please shutdown your universe and reboot
> --
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to