hi, i have a problem with my MCUXPRESSO compiler, i instantiated my object before main through the constructor method, i put a breakpoint at the first instruction in main so i can read the values contained by the instantiated object and nothing, the object is completely empty, this object has been used for other compilers where i instantiated it before calling main with no problems.... i was wondering how i can fix this.
已解决! 转到解答。
Caso risolto, non so per quale motivo mi trovavo nella cartella "startup" due file uno "startup_mkv42f16.c" e l'altro "startup_mkv42f16.cpp" semplicemente togliendo il file .c ho risolto il problema. Grazie!
Hi, thanks for the reply, I created the project using the mcuxpresso configurator by selecting c++, but for some strange reason when I debug, I saw that the "startup_mkv42f16.c" file is called, I try to follow the link you sent me, if Advice comes to your mind and I gladly accept it. Thank you!
Are you using a startup code which has the C++ constructor calls implemented?
If you are compiling/using a C startup code, it will not call the _libc_init_array().
If your project is a C project and you want to convert it into a C++ one, see https://mcuoneclipse.com/2020/07/11/from-c-to-c-converting-eclipse-c-projekts/
I hope this helps,
Erich
Caso risolto, non so per quale motivo mi trovavo nella cartella "startup" due file uno "startup_mkv42f16.c" e l'altro "startup_mkv42f16.cpp" semplicemente togliendo il file .c ho risolto il problema. Grazie!