Hi,
I'm starting a project using a Delfino MCU and I was wondering if there is support for C++ stuff ( class, new/delete, etc...) ? If yes, how can I setup a project in CCS 4 to do that?
Thank you very much!
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.
Simon said:I'm starting a project using a Delfino MCU and I was wondering if there is support for C++ stuff ( class, new/delete, etc...) ? If yes, how can I setup a project in CCS 4 to do that?
The compiler knows that a file is C++ by the extension (i.e. .c vs .cpp or .cxx). See section 2.3.4 of the compiler ref guide: www.ti.com/lit/spru514.
What parts of C++ are supported by the compiler is documented in the compiler reference guide. See section 6.2 and 6.12.3.
Regards
-Lori
Ok, I created a file .cpp and an header file .h containing the class declaration. I saw that the header extension for a c++ header file is .hh. So, I changed my header file extension to .hh. When I compile, I get the same errors, "identifier "class" is undefined" and "identifier "new" is undefined". Maybe I need to include or link to something else to be able to compile with those instructions/keywords...
The .cpp extension is enough to tell the compiler this is C++ source, and not C. The header file extension does not matter.
I'm not sure what is causing the behavior you see. Please post the build log CCS creates when you compile. I think we'll be able figure it out from that.
Thanks and regards,
-George
Hi,
I fixed the problem... It was my bad. I had a .c file in the project. I changed it to cpp and it worked. I had forgotten this one :)
Thank you very much!