Using "StandardCPlusPlus" library with teensy doesn't compile. Works on arduinos
Hardware: teensy 3.2
Software: teensyduino 1.28-beta1 on Arduino 1.6.8 on windows 10
I'm looking at ManiacBug's standard C++ Library as a possible way to simplify some of my code, so I'm not reinventing the wheel if it's unneeded (specifically vectors are looking nice).
It hasn't been updated in about 4 years, so I'm not exactly hopeful for getting an official patch, and it works fine on arduinos. So it's really doing its job properly, I'm just asking more of it. (Although I realize the teensy is quite different from arduinos, and the compile flags tend to differ slightly)
ANYWAYS: so just including the library (My code is literally "#include <StandardCplusplus.h>" with an empty setup and loop) causes the compile to fail
Link to the sourcecode where the error occurs
It seems those errors are all coming from exception casts, so assuming I won't be doing exception catching, would just removing exception catching work? An error would always result in me restarting the teensy anyways. Probably terrible practice, but it will ultimately be running in a vacuum, so if it runs fine during my testing, nothing should really change during its actual job
But compiling for any real arduinos seems to work fine (compiling for a mega):
Granted, they don't tend to really tell you ANYTHING if it compiles (I've noticed teensy shows warnings. which is kinda annoying, because I have a few libraries that use warnings to tell you their version number), but the point is that it compiles fine.
So my question really is: Is there a straightforward way to fix these errors/is there a better c++ library to use/should I just reinvent the wheel, as it'll be easier? I have written a rather nice linkedlist class before, but arduino doesn't like templates, so it doesn't work, and thus would have to be rewritten exclusively for this. Also even the examples fail to compile with other, very different errors, so I feel like I'll be fighting it 90% of the way
While I'm here: I'm currently using FastLED to drive 350 LEDs. that's easy enough, but at any single frame, 50% or more will be turned off (some static frames only have about 60 (=17%) of the LEDs lit), so is there a library that allows me to use less dynamic memory? It's not really a problem, I just know I won't be able to use an arduino uno in the end because I have to store 1,050 uint8's. Like I said: not really a pressing issue, the total library only takes up 1,793 bytes of dynamic memory (5,952 bytes on a teensy, but I realize the teensy takes up much more space for good reasons). Some of that are some arrays (base frames that have about 25 uint8's each) that'll never be changed, so I'm trying to find an easy way to store them in the program space (you'd think marking them const would handle that, but I'm just being lazy, and I know that)
Hardware: teensy 3.2
Software: teensyduino 1.28-beta1 on Arduino 1.6.8 on windows 10
I'm looking at ManiacBug's standard C++ Library as a possible way to simplify some of my code, so I'm not reinventing the wheel if it's unneeded (specifically vectors are looking nice).
It hasn't been updated in about 4 years, so I'm not exactly hopeful for getting an official patch, and it works fine on arduinos. So it's really doing its job properly, I'm just asking more of it. (Although I realize the teensy is quite different from arduinos, and the compile flags tend to differ slightly)
ANYWAYS: so just including the library (My code is literally "#include <StandardCplusplus.h>" with an empty setup and loop) causes the compile to fail
Code:
In file included from C:\Users\john\Documents\Arduino\libraries\StandardCplusplus\eh_alloc.cpp:25:0:
C:\Users\john\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:176:36: error: ISO C++ forbids casting to an array type '_Unwind_Exception_Class {aka char [8]}'
= ((((((((_Unwind_Exception_Class) 'G'
^
C:\Users\john\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:177:36: error: ISO C++ forbids casting to an array type '_Unwind_Exception_Class {aka char [8]}'
<< 8 | (_Unwind_Exception_Class) 'N')
^
C:\Users\john\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:178:35: error: ISO C++ forbids casting to an array type '_Unwind_Exception_Class {aka char [8]}'
<< 8 | (_Unwind_Exception_Class) 'U')
^
C:\Users\john\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:179:41: error: ISO C++ forbids casting to an array type '_Unwind_Exception_Class {aka char [8]}'
<< 8 | (_Unwind_Exception_Class) 'C')
^
C:\Users\john\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:180:40: error: ISO C++ forbids casting to an array type '_Unwind_Exception_Class {aka char [8]}'
<< 8 | (_Unwind_Exception_Class) 'C')
^
C:\Users\john\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:181:39: error: ISO C++ forbids casting to an array type '_Unwind_Exception_Class {aka char [8]}'
<< 8 | (_Unwind_Exception_Class) '+')
^
C:\Users\john\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:182:38: error: ISO C++ forbids casting to an array type '_Unwind_Exception_Class {aka char [8]}'
<< 8 | (_Unwind_Exception_Class) '+')
^
C:\Users\john\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:183:37: error: ISO C++ forbids casting to an array type '_Unwind_Exception_Class {aka char [8]}'
<< 8 | (_Unwind_Exception_Class) '\0');
^
Error compiling for board Teensy 3.2 / 3.1.
It seems those errors are all coming from exception casts, so assuming I won't be doing exception catching, would just removing exception catching work? An error would always result in me restarting the teensy anyways. Probably terrible practice, but it will ultimately be running in a vacuum, so if it runs fine during my testing, nothing should really change during its actual job
But compiling for any real arduinos seems to work fine (compiling for a mega):
Code:
Build options changed, rebuilding all
Sketch uses 674 bytes (0%) of program storage space. Maximum is 253,952 bytes.
Global variables use 15 bytes (0%) of dynamic memory, leaving 8,177 bytes for local variables. Maximum is 8,192 bytes.
Granted, they don't tend to really tell you ANYTHING if it compiles (I've noticed teensy shows warnings. which is kinda annoying, because I have a few libraries that use warnings to tell you their version number), but the point is that it compiles fine.
So my question really is: Is there a straightforward way to fix these errors/is there a better c++ library to use/should I just reinvent the wheel, as it'll be easier? I have written a rather nice linkedlist class before, but arduino doesn't like templates, so it doesn't work, and thus would have to be rewritten exclusively for this. Also even the examples fail to compile with other, very different errors, so I feel like I'll be fighting it 90% of the way
While I'm here: I'm currently using FastLED to drive 350 LEDs. that's easy enough, but at any single frame, 50% or more will be turned off (some static frames only have about 60 (=17%) of the LEDs lit), so is there a library that allows me to use less dynamic memory? It's not really a problem, I just know I won't be able to use an arduino uno in the end because I have to store 1,050 uint8's. Like I said: not really a pressing issue, the total library only takes up 1,793 bytes of dynamic memory (5,952 bytes on a teensy, but I realize the teensy takes up much more space for good reasons). Some of that are some arrays (base frames that have about 25 uint8's each) that'll never be changed, so I'm trying to find an easy way to store them in the program space (you'd think marking them const would handle that, but I'm just being lazy, and I know that)