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

Problem : Don't create global static class (fwd)



>Subject: Problem : Don't create global static class
>
>Hello I'm student in Korea
>I'm testing next example.
>I think that this example print next line in console.->
>"   I'm in class constructor
>    test point
>    I'm in class destructor "
>
>but this example print console that-->
>"
>   test point
>   I'm in class destructor "
>
>Reason : RTEMS don't create global static class
>I don't  know this reason and don't solve it.
>Teach Me
>Thank you
>
>example source code :
>--------------------------------------------
>#include <rtems.h>
>#include <stdio.h>
>#include <stdlib.h>
>extern "C" {
>extern rtems_task main_task(rtems_task_argument);
>}
>class A {
>public:
>    A(void)   { printf("\nI'm in class constructor \n"); };
>    test(void)  { printf("test point  \n");   }
>    virtual ~A() { printf("\nI'm in class destructor \n"); };
>};
>
>static  A king;
>
>void
>test_main(void)
>{ 
>    king.test();
>}
>
>rtems_task main_task( rtems_task_argument )
>{
>    test_main();
>    exit(0);
>}



Lee,

Could you provide more information about the platform and BSP that
you are using ?

For i386 ELF and BSPs ==> pc386/i386ex this problem got solved a few weeks back.
The patches still under way. It requires changes to GCC and RTEMS.
Wait a little bit longer, and they'll be available at some point.

If you are using other platform or BSP, RTMES' team requires a lot of help
to sort these things out.

NOTE: I do not speak for OARcorp. I am just a happy RTEMS' user.

Regards, Rosimildo.