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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...