Hello,
For C++ project, how to complete the constructors function call in start up file?
Solved! Go to Solution.
Hi @rodger_an ,
not sure if I understood your question. But you might have a look at my blog article on a related subject: https://mcuoneclipse.com/2020/07/11/from-c-to-c-converting-eclipse-c-projekts/
See the section about the C++ startup code.
The thing is that you can call the constructor initialization for global objects in the startup code, but this depends on the standard library used.
I hope this helps,
Erich
Hi @rodger_an ,
not sure if I understood your question. But you might have a look at my blog article on a related subject: https://mcuoneclipse.com/2020/07/11/from-c-to-c-converting-eclipse-c-projekts/
See the section about the C++ startup code.
The thing is that you can call the constructor initialization for global objects in the startup code, but this depends on the standard library used.
I hope this helps,
Erich
Thank you! ErichS.
Now I know the Cpp start up file . And know how to generate a ld script for C++ project.
Hi @rodger_an
You can create a function which call the constructor in main.c. Then call this function in startup file. This function must be called after everything initialized.
Regards,
Jing
Hi JINGPAN,
Thanks for your direction.