how to use global C++ object variables - Aurix - TC297B App Kit - HIGHTEC compiler

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,

I have to use global C++ objects in my project. When I declare global objects, an object is created but the constructors are not being called.

I did some research and found that constructors have to be placed in .ctors section and the constructors will be called in the startup code by function _init linked using crti.o

but this is not working for me. Could anyone help in this regard


Thanks!!
0 Likes
3 Replies
Not applicable
Thank you HRusch!

But the link was for Destructor problem and still my problem is open!! and what will happen by the below statement
void *__dso_handle; I read in the link somewhere that adding this statement will solve the destructor problem!!
0 Likes
Not applicable
My latest tests showed me, that it worked.
You don't need -fno-use-cxa-atexit or void *__dso_handle anymore, if you are using the newest DAVE version.

I see that you use "Hightec compiler", therefore I cannot help.
C++ must be handled correct in the startup code of the toolchain.
0 Likes