Jump to content
Sign in to follow this  
sketchy

embedXCode + LaunchPad + realloc() = "...not declared in this scope"

Recommended Posts

I am using embedXCode+ on a Launchpad MSP430

 

 

I am trying to use arduino-menusystem:  https://github.com/jonblack/arduino-menusystem. The MenuSystem.cpp uses realloc(). While this works fine if the board is Arduino Uno, I get a "not declared in this scope" when building for the Launchpad.

 

Is there a better dynamic memory allocation routine to use when writing for the Arduino IDE? OR advice on how to fix this? (thank you)

Share this post


Link to post
Share on other sites

http://stackoverflow.com/questions/7007468/g-error-malloc-was-not-declared-in-this-scope

 

suggest adding

#include <cstdlib>

I'm not sure how the embedXCode compiler is setup. So this may or may not work.

 

 

Personally I would recommend removing the dynamic memory, and creating a fixed size array to store the menu items. But that's just my opinion.

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...