On Wed, 30 May 2001, David Olofson wrote:
> In your main C++ module, you need to do something like
>
> extern "C" {
> #include <linux/module.h>
>
> int init_module(void);
> void cleanup_module(void);
> __do_global_ctors_aux();
> __do_global_dtors_aux();
> };
>
> and then call __do_global_ctors_aux() from init_module(), and
> __do_global_dtors_aux() from cleanup_module(). That way, your global
> variables and object instances will be initialized and destroyed properly
> when the module is loaded and removed, respectively.
Well, I am not an gcc expert too, but I have a class with one
static atribute and some static methods and I did not need to do
anything but using the usual C++ syntax.
I have compiled it separately and linked it with the main
object file of the module.
the static attribute is an object that does not have a default
constructor... Indeed it has only a int attribute and some methods
(the methods call rt-fifo functions). is this relevant?
-----------------------------------------------------------
Luiz Gustavo Bizarro Mirisola
Mestrando em Ciencia da Computacao - IC-Unicamp/LRV-IA-CTI
MSc Student in Computer Science
[EMAIL PROTECTED]
-----------------------------------------------------------
-- [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/rtlinux/
Re: [rtl] RTLinux: C++ static members != good ?
Luiz Gustavo Bizarro Mirisola Thu, 31 May 2001 09:36:28 -0700
- Re: [rtl] RTLinux: C++ static members != goo... Heinz Haeberle
- Re: [rtl] RTLinux: C++ static members !... Jan Albiez
- Re: [rtl] RTLinux: C++ static members !... Heinz Haeberle
- Re: [rtl] RTLinux: C++ static members !... David Olofson
- Re: [rtl] RTLinux: C++ static members !... Luiz Gustavo Bizarro Mirisola
- Re: [rtl] RTLinux: C++ static members !... Erwin Rol
- Re: [rtl] RTLinux: C++ static members !... Jan Albiez
