problem with my MCUXPRESSO compiler C++

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

problem with my MCUXPRESSO compiler C++

ソリューションへジャンプ
1,051件の閲覧回数
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,025件の閲覧回数
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,026件の閲覧回数
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,028件の閲覧回数
ErichStyger
Senior Contributor V

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,026件の閲覧回数
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 件の賞賛
返信