problem with my MCUXPRESSO compiler C++

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

problem with my MCUXPRESSO compiler C++

跳至解决方案
1,156 次查看
mich28
Contributor II

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.

 

0 项奖励
回复
1 解答
1,130 次查看
mich28
Contributor II

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!

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,131 次查看
mich28
Contributor II

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!

0 项奖励
回复
1,133 次查看
ErichStyger
Specialist I

Are you using a startup code which has the C++ constructor calls implemented?

ErichStyger_0-1680700420903.png

 

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

0 项奖励
回复
1,131 次查看
mich28
Contributor II

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!

0 项奖励
回复