9 years, 4 months ago.

how to use c++ code on mbed kit

Hi all,

I am new to mbed kit programming, I want to know if we can directly use c++ code that I have compiled on a c++ compiler(code blocks) on the mbed kit??

I mean what about the header files? I have used header files like iostream, fstream, etc., in my c++ code, so do I need to import some libraries when I want to run it on my mbed, or do I need to upload the c++ code for the header files??

Thanks,

1 Answer

9 years, 4 months ago.

Standard c++ system headers are available so no need to upload them. stdin, stdout and stderr are supported and default to the first serial port which will be connected to the debug/upload USB port (1)

Any file operations require you to have an SD card socket and use the SDFilesystem library(2)

However keep in mind that this is an embedded system not a desktop computer, the standard libraries are large and can take up a big chunk of the available flash space so only include them if you need them.

(1) There are lots of different mbed platforms so there are a few exceptions to this but it's true for almost all versions.

(2) The first two mbeds (LPC1768 and LPC11u24) also support LocalFilesystem which gives you some storage without an SD card.