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.

C++ external files or project in C++ altogether

Other Parts Discussed in Thread: ENERGIA

Hi everyone,

So some friends are using the Tivaware in CCS.
They wanted to use a LCD library from Energia (so it's with GNU compiler) hopping to not need to make much changes.
The library has classes and strings and those are being the problem.

Is there anyway to use it or it's required to adapt it all to C (no classes, strings or function name overload?) when using TI compiler?

  • Hello Luis

    AFAIK, TI compiler supports C++ construct as long as the files are named cpp in the project. There are some bugs though ( a forum search may be useful)

    Regards
    Amit
  • Hi Amit,

    Thanks for the fast response.

    I have searched and didn't really get anything useful. I will try to search better.

    .cpp files actually don't even compile when written in C. It's seems to not be linking the .h to the .cpp
  • Hello Luis

    cpp files compile in CCS Check the compilation options. Following post (search string cpp)

    e2e.ti.com/.../1284780

    Regards
    Amit
  • Hi Luis,

    CCS, version 6.x has the ability to open .ino  files and automatically transform them to .cpp files and build the project. More, the debugger is able to debug those projects. Even you can add Energia library. Check the project menu (I think) - I made such project  - but be careful, you need some small modifications, those were shown by Amit in older Tiva posts, I did not recorded them (unfortunately...). Useful to check KSLs CCS in club...

    Petrei

  • Hi Petrei,

    I am aware but I would like to use the TI compiler :)

    Amit, I will have to check this better. I ended up adapting the file to C, it was actually pretty quick... the use of classes is useful but what I am really missing is the string manipulation in C++ :/
    Later I will try to see if I can get it working in C++ but that will be most likely just next month
  • Hello Luis,

    Petrei does have a point though.

    Regards
    Amit
  • Hi Amit,

    I haven't really looked into it since I got it working in C (I adapted the library).
    I don't meant to seem that I am ignoring yours and Petrei answers, it's just, it's working now (in C) and I can't really now take time to see if I can get C++ files working.

    After the first week of July I will be done with exams so only after that I will be able to check that + also gimme a week to be really, really, really lazy (and maybe make some capacitor fireworks)