This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Is there some startup file for c++ code? I need something like that.

Hi, I'm doing a new project based on the project of this website http://scriptogr.am/syntaxerror/post/porting-freeimu-code-to-stellaris-launchpad, but I can not make the program run on eclipse, I used to use IAR to workbench MSP430 but now due to startup_ewarm.c is a file written in c, it doesn't work with my code in c++, I tried also with CCS V5.3, Keil and Codesourcery, but at most I get the same result, I really need it!! any suggestions? I need many interrupts vectors for whole my project, and I can't do it. I have no much time and practically I need to do my project with c++ classes.

Is there a way to write the startup file for c++ code for any IDE?? Or is there a way to setup any IDE to do what I'm looking for?

Thanks a lot. Thank you very much in advance, I hope you can help me!

  • Trying to port toolchain-dependant startup code is tricky, and actually a PITA. Any mistake will leave you lost in the woods.

    My standard approach is to setup a new project with all the appropriate parameters (MCU variant, FPU, libs, C/C++), and pull in the code to port afterwards. I'm using CrossWorks which is rarely supported directly by any silicon vendor, so I'm doing it often.

    And yes, C++ usually requires a special startup code. But this is arranged for by your IDE, when selecting a C++ project - if supported. You don't need to write you own.

  • I think IAR will automatically link their c-startup called: __iar_program_start to your code. You can replace that with your own if you like.

  • Thanks a lot for your answers... my code now works... I was researching and I found this website http://www.iar.com/en/IAR/Webinars/Writing-C-for-ARM-Cortex-M3/ and this one http://electronix.ru/forum/lofiversion/index.php/t93753.html and I make my own startup code for c++ programming on IAR WORKBENCH... 

    Regards from México! Thanks again.