-
Notifications
You must be signed in to change notification settings - Fork 13
Home
Yes, Virginia, there is a C++ standard library suitable for use on AVR microcontrollers, including the Arduino, and this is the (most complete, tested, and liberally-licensed) one!
This work is based on the upstream STLport project and its git repositories. Modified version of master
(in this repo as STLport-master-avr) and STLport-5.2
(in this repo as STLport-5.2-avr) have been made to allow compilation with the [avr-libc][] and avr-gcc
toolchain. Emphasis has been on the header-only aspect of the library, however, the standard build system does work to a degree, with e.g. these commands:
./configure --target=avr
make release-static
In addition, to allow use with the Arduino IDE, the headers as well as a dummy header have been exported to branches suitable for use as Git submodules in a Git-managed sketchbook, or directly as Git repos in an unmanaged sketchbook. The branches are named STLport-master-arduino-installed and STLport-5.2-arduino-installed respectively. Note that if you are using the actual Arduino IDE to build, you must use the 5.2 version. The master version is made available if you're using an Arduino-inspired build system such as Arduino-Makefile that allows you to pass additional compiler flags. (See below for details.)
Simple: There are two different stability levels corresponding to two different C++ standards. Then, you just need to determine if your build is Arduino-like or not. You'll end up with a branch name like "STLport-version-arduinovariantornot".
-
The
master
branch/version, aka the future STLport 6.0, is a C++11 standard library. If that is what you want, and your version ofavr-gcc
can handle it (be sure to pass-std=gnu++11
or-std=gnu++0x
in with your project'sCXXFLAGS
), use the branches based on the versionmaster
. Note that a number of features (chrono
,thread
, etc) are disabled due to the lack of an underlying operating system and/or libc with the required features, so you won't get the full C++11 standard library. Keep in mind that the master branch is apparently an unreleased work in progress - I haven't talked with upstream to find out how "complete" they consider it. -
The
5.2
branches are based on a stable release branch. If you don't need C++11 support (k), and particularly if you need to support the Arduino IDE (where you can't pass additional compiler flags), stick with these branches. They are named with5.2
in the version field as described above.
-
If you're using an Arduino-like build system, the variant you want ends in
arduino-installed
. See Arduino-Style Build Systems for more info. -
If you're not using anything to build that requires an Arduino-like layout, you've got choices between
arduino-installed
andavr
. See Other AVR Build Systems for details.