sketchy 0 Posted June 24, 2014 Share Posted June 24, 2014 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) Quote Link to post Share on other sites
greeeg 460 Posted June 24, 2014 Share Posted June 24, 2014 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. Quote Link to post Share on other sites
sketchy 0 Posted June 24, 2014 Author Share Posted June 24, 2014 thanks very much. I did try #include <cstdlib.h> with no success :-(. Quote Link to post Share on other sites
Rei Vilo 695 Posted June 24, 2014 Share Posted June 24, 2014 Does the realloc() function work on Energia? embedXcode uses the same tool-chain. Quote Link to post Share on other sites
roadrunner84 466 Posted June 25, 2014 Share Posted June 25, 2014 thanks very much. I did try #include <cstdlib.h> with no success :-(. Either include cstdlib or stdlib.h, not cstdlib.h Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.