[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] RTLinux: C++ static members != good ?
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
mirisola@dcc.unicamp.br
-----------------------------------------------------------