vancegroup/stlport-avr

Does not compile on Arduino 1.0.6

Opened this issue · 0 comments

STLport-5.2-arduino-installed does not appear to work on Arduino 1.0.6. I followed the installation instructions from this wiki page on a brand new Arduino installation, but when I run the example code below, it does not compile.

#include <stlport.h>
#include <vector>
#include <cstdint>

std::vector<std::uint8_t> vec(10, 0);

void setup() {
    vec[0] = 5;
    vec[3] = 2;
    Serial.begin(115200);
}

void loop() {
    for (std::vector<uint8_t>::iterator it = vec.begin(), e = vec.end(); it != end; ++i) {
        Serial.println(*it);
    }
    sleep(2000);
}

Specifically, I get the errors:

sketch_mar17a:5: error: 'uint8_t' is not a member of 'std'
sketch_mar17a:5: error: 'uint8_t' is not a member of 'std'
sketch_mar17a:5: error: template argument 1 is invalid
sketch_mar17a:5: error: template argument 2 is invalid
sketch_mar17a:5: error: invalid type in declaration before '(' token
sketch_mar17a:5: error: initializer expression list treated as compound expression
sketch_mar17a.ino: In function 'void setup()':
sketch_mar17a:8: error: invalid types 'int[int]' for array subscript
sketch_mar17a:9: error: invalid types 'int[int]' for array subscript
sketch_mar17a.ino: In function 'void loop()':
sketch_mar17a:14: error: request for member 'begin' in 'vec', which is of non-class type 'int'
sketch_mar17a:14: error: request for member 'end' in 'vec', which is of non-class type 'int'
sketch_mar17a:14: error: 'end' was not declared in this scope
sketch_mar17a:14: error: 'i' was not declared in this scope
sketch_mar17a:17: error: 'sleep' was not declared in this scope

Is this a version specific error, and if so, what Arduino versions are supported?