Jump to content
Sign in to follow this  
L.R.A

C++ in TI compiler - using Energia libraries

Recommended Posts

Hi everyone,

So I wonder if anyone ever had this problem and got around it.


So I wanted to use a nokia 5510 LCD. So I remembered Rei Villo library that I used before with Energia.
I had to of course change some energia specific functions but that wasn't my biggest problem.
Well how the heck do you use C++ in TI compiler? I had to take off the class and worse than that I have to use c strings...

Btw if anyone has good info on c string manipulation I would appreciate it

 

Share this post


Link to post
Share on other sites

"good info in c string" is a bit vague, c strings are just arrays of characters, of which last one mush be a binary 0.

The compiler does support C++, maybe you need to tell it to compile C++ by adding the "-std=c++" parameter to the compiler.

Consider that most microcontrollers (in particular the msp430g2xxx series) are really constrained in capabilities (read: memory). Using dynamic memory (a.k.a. heap or free space) is killing for such applications, this also occurs when concatenating two C++ String objects!

Share this post


Link to post
Share on other sites

Thank you all for the answers.
 

"good info in c string" is a bit vague, c strings are just arrays of characters, of which last one mush be a binary 0.

The compiler does support C++, maybe you need to tell it to compile C++ by adding the "-std=c++" parameter to the compiler.

Consider that most microcontrollers (in particular the msp430g2xxx series) are really constrained in capabilities (read: memory). Using dynamic memory (a.k.a. heap or free space) is killing for such applications, this also occurs when concatenating two C++ String objects!

yep pretty vague, sorry about that :P
I was basically asking info on C strings because I barely even use them (didn't even remembered sprintf or atoi).
The MCU I'm gonna use the the Tiva and I don't intend to use in critical parts. Just to display some values.


@@oPossum and @@roadrunner84, .cpp -> classes don't really work nor do strings in c++, So I don't know what's the problem...
I didn't try the parameter for the compiler I should try it out later. Thank you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×