Giter VIP home page Giter VIP logo

standardcplusplus's Introduction

Standard C++ for Arduino

What is this?

This is a straight port of uClibc++ for Arduino. I have cut nothing out and held nothing back. Use with care!

That said, I have used uClibc++'s own internal configuration to pare back un-needed stuff, like support for floats, gratuitous template instantiations and other things. See system_configuration.h for all of those gory details.

Plus I added in Andy Brown's excellent ohserialstream class for managing the HardwareSerial as an ostream.

How do I install it?

This is installed just like a regular Arduino library. Unpack the contents of the distribution into the 'libraries' folder under your sketchbook. For example, my sketchbook is at /home/maniacbug/Source/Arduino, so this library is in /home/maniacbug/Source/Arduino/libraries/StandardCplusplus .

Be sure to reset your Arduino IDE after installing it.

How do I use it?

You need an extra #include. It has to come before C++ standard library #includes:

#include <StandardCplusplus.h>

Otherwise, you will see cryptic messages like this:

fatal error: vector: No such file or directory

How do I try it out?

From the Arduino IDE, navigate the menus to: File > Examples > StandardCplusplus > string_vector

Upload that, set your serial monitor to 57600 baud, and check the output.

How do I learn more?

The web is your friend. cplusplus.com is my personal favorite reference.

Which versions does it work with?

Arduino 1.0 and beyond.

What is the license?

uClibc++ is LGPL, so this port is also. Andy's file is actually CC-BY-SA, however he indicated he'd be releasing it using the 3-clause modified BSD license, so it will be fully compatible with uClibc++.

standardcplusplus's People

Contributors

allyourcode avatar amotl avatar eric-wieser avatar gorilux avatar ivankravets avatar maniacbug avatar mike-matera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

standardcplusplus's Issues

functional not functional

using the latest Arduino IDE, I try to define a callback type that will be lambda compatible like...

typedef std::function<void(float progress)> AnimUpdateCallback;

and I get a compile error about std.

Problem with vector library

Hello,

I'm currently trying to use your library to make a school project, and I prefer to use vectors instead of double-sized array. It worked well on my last project (made last week), but now, when I try to add the vector library, I get the following errors :

C:\Users\benoit\Documents\Arduino\libraries\StandardCplusplus/vector:43:94: error: macro "swap" passed 4 arguments, but takes just 2

template <class T, class Allocator> void swap(vector<T,Allocator>& x, vector<T,Allocator>& y);

                                                                                          ^

C:\Users\benoit\Documents\Arduino\libraries\StandardCplusplus/vector:520:106: error: macro "swap" passed 4 arguments, but takes just 2

template <class T, class Allocator> _UCXXEXPORT void swap(vector<T,Allocator>& x, vector<T,Allocator>& y){

Il works well with the example file and my previous project, so I don't know what to do...

I just include the standardCplusplus.h and vector headers at beginning of my .ino file.

Compilation error

After copying files into the /Arduino/libraries/StandardCplusplus folder, IDE returns a compilation error because some operators are defined twice (with Arduino 1.0.4).
The solution I've found to bypass the problem is to delete the following files:

  • StandardCplusplus / new_opv.cpp
  • StandardCplusplus / del_opv.cpp

Hope it helps

logic_error

When I try to throw a logic_error, I am given an error saying: namespace "std" has no member "logic_error". I have included the stdexcept header.

expected unqualified-id before 'long'

I'm trying to use this library and hitting a problem. Below is the (verbose) output. I did notice that the StandardCplusplus.h include does an #undef abs, which I'm assuming is related to this, but including that file or not made no difference in my project. Any ideas?...thanks in advance.

[ 68%] Building CXX object CMakeFiles/hub.dir/src/main.cpp.obj
/home/jmitchell/Arduino/avr8-gnu-toolchain-linux_x86_64/bin/avr-g++ -DUBRRH -DUBRR0H -DUBRR1H -DUBRR2H -DUBRR3H -DDEBUG_K=1 -g -Os -mcall-prologues -ffunction-sections -fdata-sections -fno-exceptions -I/home/jmitchell/Arduino/libraries/Arduino-Style/StandardCplusplus -I/home/jmitchell/Arduino/libraries/messaging -I/home/jmitchell/Arduino/arduino-1.0.1/libraries -I/home/jmitchell/Arduino/arduino-1.0.1/hardware/arduino/variants/mega -DF_CPU=16000000L -DARDUINO=100 -mmcu=atmega2560 -I/home/jmitchell/Arduino/arduino-1.0.1/hardware/arduino/cores/arduino -I/home/jmitchell/Arduino/arduino-1.0.1/libraries -I/home/jmitchell/Arduino/arduino-1.0.1/hardware/arduino/variants/mega -I/home/jmitchell/Arduino/libraries/Arduino-Style/SoftwareSerial -I/home/jmitchell/Arduino/arduino-1.0.1/libraries/Wire -I/home/jmitchell/Arduino/libraries/Arduino-Style/Usb -I/home/jmitchell/Arduino/libraries/Arduino-Style/AndroidAccessory -I/home/jmitchell/Arduino/libraries/Arduino-Style/DebugPrint -I/home/jmitchell/Arduino/libraries/Arduino-Style/Time -o CMakeFiles/hub.dir/src/main.cpp.obj -c /home/jmitchell/Arduino/applications/hub/src/main.cpp
In file included from /home/jmitchell/Arduino/libraries/Arduino-Style/StandardCplusplus/memory:22:0,
from /home/jmitchell/Arduino/libraries/Arduino-Style/StandardCplusplus/char_traits:22,
from /home/jmitchell/Arduino/libraries/Arduino-Style/StandardCplusplus/iosfwd:21,
from /home/jmitchell/Arduino/libraries/Arduino-Style/StandardCplusplus/iterator:21,
from /home/jmitchell/Arduino/applications/hub/src/main.cpp:32:
/home/jmitchell/Arduino/libraries/Arduino-Style/StandardCplusplus/cstdlib:60:14: error: expected unqualified-id before 'long'
/home/jmitchell/Arduino/libraries/Arduino-Style/StandardCplusplus/cstdlib:60:14: error: expected ')' before 'long'
/home/jmitchell/Arduino/libraries/Arduino-Style/StandardCplusplus/cstdlib:60:14: error: expected ')' before 'long'

std::list<T> remove function is not working...

My Class Name: MyClass

Here is the code:

class MyCollection {

private:
    std::list<MyClass> m_list;

public:

    MyCollection() : m_list() {
    }

    void addMyClass(const MyClass & myClass) {
        m_list.push_back(myClass);
    }
    void addMyClass(const MyClass & myClass) {
        m_list.remove(myClass); //Error is occurred here
    }
}

Below is the error description:

StandardCplusplus-master/list:661: error: no match for 'operator==' in 'temp.std::list<T, Allocator>::iter_list::operator* [with T = MyClass, Allocator = std::allocator<MyClass>]() == value'

make: *** [MyLib.o] Error 1

Cannot convert int to string using library

Hello, how do I convert an int to a string using standardcplusplus?

I tried the conventional way of using stringstreams, but it gives an error:

std::string itoa(int arg) {
stringstream aa;
aa << arg;
return aa.str();

}

The error reported is error: 'string' does not name a type.

Problems in ostream and istream

In file included from C:\Users\Xavier\Documents\Arduino\libraries\StandardCplusplus/istream:24:0,

                 from C:\Users\Xavier\Documents\Arduino\libraries\StandardCplusplus/complex:20,

                 from C:\Users\Xavier\Documents\Arduino\libraries\StandardCplusplus\complex.cpp:19:

C:\Users\Xavier\Documents\Arduino\libraries\StandardCplusplus/ostream:318:50: error: default argument for template parameter for class enclosing 'class std::basic_ostream<charT, traits>::sentry'

   class _UCXXEXPORT basic_ostream<charT,traits>::sentry

                                                  ^~~~~~

In file included from C:\Users\Xavier\Documents\Arduino\libraries\StandardCplusplus/complex:20:0,

                 from C:\Users\Xavier\Documents\Arduino\libraries\StandardCplusplus\complex.cpp:19:

C:\Users\Xavier\Documents\Arduino\libraries\StandardCplusplus/istream:343:107: error: default argument for template parameter for class enclosing 'class std::basic_istream<charT, traits>::sentry'

  template <class charT,class traits = char_traits<charT> > class _UCXXEXPORT basic_istream<charT,traits>::sentry {

                                                                                                           ^~~~~~

I don't know why I got this, and I didn't #include any of the files listed anywhere. I hope these are helpful.

Problems when compiling library in Arduino IDE

It seems like there are some compilation problems related to the istream and ostream classes. I don't think it is related to my code. I get the following errors just after the compiler says the following:

Compiling library "StandardCplusplus"

In file included from C:\Users\XX\Documents\Arduino\libraries\StandardCplusplus/ostream:28:0,

             from C:\Users\XX\Documents\Arduino\libraries\StandardCplusplus/istream:24,

             from C:\Users\XX\Documents\Arduino\libraries\StandardCplusplus/complex:20,

             from C:\Users\XX\Documents\Arduino\libraries\StandardCplusplus\complex.cpp:19:

C:\Users\XX\Documents\Arduino\libraries\StandardCplusplus/ostream_helpers: In static member function 'static void std::__ostream_printout<traits, char, float>::printout(std::basic_ostream<char, traits>&, float)':

C:\Users\XX\Documents\Arduino\libraries\StandardCplusplus/ostream_helpers:250:109: error: there are no arguments to 'dtostrf' that depend on a template parameter, so a declaration of 'dtostrf' must be available [-fpermissive]

length = strlen(dtostrf(f, static_cast<int>(stream.width()), static_cast<int>(stream.precision()), buffer));

Compilation error:

In file included from /Users/timothychen_1/Documents/Arduino/libraries/StandardCplusplus-master/istream:24:0,
from /Users/timothychen_1/Documents/Arduino/libraries/StandardCplusplus-master/serstream:19,
from /Users/timothychen_1/Documents/Arduino/libraries/StandardCplusplus-master/examples/string_vector/string_vector.ino:2:
/Users/timothychen_1/Documents/Arduino/libraries/StandardCplusplus-master/ostream:318:50: error: default argument for template parameter for class enclosing 'class std::basic_ostream<charT, traits>::sentry'
class _UCXXEXPORT basic_ostream<charT,traits>::sentry
^~~~~~
In file included from /Users/timothychen_1/Documents/Arduino/libraries/StandardCplusplus-master/serstream:19:0,
from /Users/timothychen_1/Documents/Arduino/libraries/StandardCplusplus-master/examples/string_vector/string_vector.ino:2:
/Users/timothychen_1/Documents/Arduino/libraries/StandardCplusplus-master/istream:343:107: error: default argument for template parameter for class enclosing 'class std::basic_istream<charT, traits>::sentry'
template <class charT,class traits = char_traits > class _UCXXEXPORT basic_istream<charT,traits>::sentry {
^~~~~~

exit status 1

Compilation error: exit status 1

std::cin doesn't wait for characters.

The implementation of basic_serialbuf treats having no characters available as an EOF condition. It expects that read() and peek() are blocking as they would be in an implementation on a OS. In Arduino they are non-blocking and return -1 when there's no characters available. The following patch fixes the behavior:

---
 serstream | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/serstream b/serstream
index 268053b..24d12e4 100644
--- a/serstream
+++ b/serstream
@@ -130,10 +130,11 @@ namespace std
         */

                virtual int_type underflow(){
-                       if(_serial.available())
-                               return _serial.peek();
-                       else 
-                               return traits::eof();
+                       // There is no EOF condition on a serial stream.
+                       // underflow() and uflow() should block, reproducing the 
+                       // OS behavior when there are no charaters to read.
+                       while (! _serial.available()) { /* wait */ }
+                       return _serial.peek();
                }

        /*
@@ -141,10 +142,9 @@ namespace std
         */

                virtual int_type uflow(){
-                       if(_serial.available())
-                               return _serial.read();
-                       else 
-                               return traits::eof();
+                       // See underflow() above
+                       while (! _serial.available()) { /* wait */ }
+                       return _serial.read();
                }

        /*

Bitset flip and reset overwrite adjacent memory

Both functions go like this
(size_t i = 0; i <= num_bytes; ++i){
When the should go with
(size_t i = 0; i < num_bytes; ++i){

i.e. they iterate one element to far in the internal storage.

Issue with compilation Arduino Leonardo

I get an error compiling the example program serstream:

serstream.ino:11:29: error: no matching function for call to ‘std::basic_oserialstream::basic_oserialstream(Serial_&)’
serstream.ino:11:29: note: candidates are:
In file included from serstream.ino:2:0:
/home/mike/arduino/libraries/StandardCplusplus/serstream:230:12: note: std::basic_oserialstream<charT, traits, Tserial>::basic_oserialstream(Tserial&) [with charT = char; traits = std::char_traits; Tserial = HardwareSerial]
/home/mike/arduino/libraries/StandardCplusplus/serstream:230:12: note: no known conversion for argument 1 from ‘Serial_’ to ‘HardwareSerial&’
/home/mike/arduino/libraries/StandardCplusplus/serstream:213:60: note: std::basic_oserialstream::basic_oserialstream(const std::basic_oserialstream&)
/home/mike/arduino/libraries/StandardCplusplus/serstream:213:60: note: no known conversion for argument 1 from ‘Serial_’ to ‘const std::basic_oserialstream&’

Dead project?

Last commit on 22 Sep 2013 and it is doesn't work on Platformio and Arduino UNO. I'm getting plenty errors when doing build. But works with the ArduinoSTL lib.

The errors:

...
.pio/libdeps/uno/StandardCplusplus/ostream:318:50: error: default argument for template parameter for class enclosing 'class std::basic_ostream<charT, traits>::sentry'
.pio/libdeps/uno/StandardCplusplus/istream:343:107: error: default argument for template parameter for class enclosing 'class std::basic_istream<charT, traits>::sentry'
.pio/libdeps/uno/StandardCplusplus/ostream:318:50: error: default argument for template parameter for class enclosing 'class std::basic_ostream<charT, traits>::sentry'
...

Bug when using the library

I'm trying to use the library, but I'm facing this bug.

image

My OS is Debian 12

nilson@acerAspire:~$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"

My Arduino IDE is 1.8.19

nilson@acerAspire:~$ apt list arduino
Listing... Pronto
arduino/stable,now 2:1.8.19+dfsg1-1 amd64 [installed]

Error in compiling

In file included from /Users/admin/Documents/Arduino/libraries/StandardCplusplus-master/new_handler.cpp:20:0:
/Users/admin/Documents/Arduino/libraries/StandardCplusplus-master/new:40:54: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
 _UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc);
                                                      ^~~~~
/Users/admin/Documents/Arduino/libraries/StandardCplusplus-master/new:43:56: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
 _UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc);
                                                        ^~~~~
new.cpp.o (symbol from plugin): In function `operator new(unsigned int)':
(.text+0x0): multiple definition of `std::nothrow'
/private/var/folders/mb/nng_3qf95xxd10qqzdty9kwh0000gn/T/arduino/sketches/E464A36164C06FF94D4FA988E81A7018/libraries/StandardCplusplus-master/new_handler.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

StandardCplusplus Library on Arduino Due

StandardCplusplus library copy & paste to Arduino/libraries/ and write sketch..

[code]

include <StandardCplusplus.h>

...
[/code]

but i got error message :

C:\Users\Alex\AppData\Local\Temp\build6039888874897731639.tmp/core.a(new.cpp.o): In function operator new[](unsigned int)': C:\Users\Alex\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.2\cores\arduino/new.cpp:26: multiple definition ofoperator new[](unsigned int)'
StandardCplusplus\new_opv.cpp.o:C:\Users\Alex\Documents\Arduino\libraries\StandardCplusplus/new_opv.cpp:24: first defined here
C:\Users\Alex\AppData\Local\Temp\build6039888874897731639.tmp/core.a(new.cpp.o): In function operator delete[](void*)': C:\Users\Alex\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.2\cores\arduino/new.cpp:34: multiple definition ofoperator delete'
StandardCplusplus\del_opv.cpp.o:C:\Users\Alex\Documents\Arduino\libraries\StandardCplusplus/del_opv.cpp:25: first defined here
collect2.exe: error: ld returned 1 exit status

Anyone have idea?

Bugs in complex

In line 310:
return complext(sinh(v.real()) * cos(v.imag()), cosh(v.real()) * sin(v.imag()) );

In line 302:
return polar(pow(v,p.real()), y.imag() * log(x) );

Support ESP8622 platform

It would be great if the ESP8266 platform could be supported.
https://github.com/esp8266/Arduino

Currently compilation stops and gives errors like

/Users/me/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -I/Users/me/Library/Arduino15/packages/esp8266/hardware/esp8266/1.6.5-804-g2d340c7/tools/sdk//include -c -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -DF_CPU=80000000L -DARDUINO=10606 -DARDUINO_MOD_WIFI_ESP8266 -DARDUINO_ARCH_ESP8266 -DESP8266 -I/Users/me/Library/Arduino15/packages/esp8266/hardware/esp8266/1.6.5-804-g2d340c7/cores/esp8266 -I/Users/me/Library/Arduino15/packages/esp8266/hardware/esp8266/1.6.5-804-g2d340c7/variants/generic -I/Users/me/Documents/Arduino/libraries/StandardCplusplus-master -I/Users/me/Documents/Arduino/libraries/StandardCplusplus-master/utility /Users/me/Documents/Arduino/libraries/StandardCplusplus-master/complex.cpp -o /var/folders/x3/6g2s9w_j5h194ry3ssgdd56c0000gp/T/build8264716523375188481.tmp/libraries/StandardCplusplus-master/complex.cpp.o 
In file included from /Users/me/Documents/Arduino/libraries/StandardCplusplus-master/ostream:28:0,
                 from /Users/me/Documents/Arduino/libraries/StandardCplusplus-master/istream:24,
                 from /Users/me/Documents/Arduino/libraries/StandardCplusplus-master/complex:20,
                 from /Users/me/Documents/Arduino/libraries/StandardCplusplus-master/complex.cpp:19:
/Users/me/Documents/Arduino/libraries/StandardCplusplus-master/ostream_helpers: In static member function 'static void std::__ostream_printout<traits, char, float>::printout(std::basic_ostream<char, traits>&, float)':
/Users/me/Documents/Arduino/libraries/StandardCplusplus-master/ostream_helpers:250:109: error: there are no arguments to 'dtostrf' that depend on a template parameter, so a declaration of 'dtostrf' must be available [-fpermissive]
    length = strlen(dtostrf(f, static_cast<int>(stream.width()), static_cast<int>(stream.precision()), buffer));
                                                                                                             ^
/Users/me/Documents/Arduino/libraries/StandardCplusplus-master/ostream_helpers:250:109: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)

Compile Issue on mac with Arduino 1.5.6-r2 software

Hello,

I get the following error when I try to compile your example string_vector on a mac with Arduino 1.5.6-r2 software. My hardware platform is a Digistump DigiX board. Any ideas?:

Arduino: 1.5.6-r2 (Mac OS X), Board: "Digistump DigiX (standard)"

In file included from /Applications/Arduino_1.5.6.app/Contents/Resources/Java/hardware/digistump/sam/libraries/StandardCplusplus/ostream:28,
from /Applications/Arduino_1.5.6.app/Contents/Resources/Java/hardware/digistump/sam/libraries/StandardCplusplus/istream:24,
from /Applications/Arduino_1.5.6.app/Contents/Resources/Java/hardware/digistump/sam/libraries/StandardCplusplus/serstream:19,
from string_vector.ino:2:
/Applications/Arduino_1.5.6.app/Contents/Resources/Java/hardware/digistump/sam/libraries/StandardCplusplus/ostream_helpers: In static member function 'static void std::_ostream_printout<traits, char, float>::printout(std::basic_ostream<char, traits>&, float)':
/Applications/Arduino_1.5.6.app/Contents/Resources/Java/hardware/digistump/sam/libraries/StandardCplusplus/ostream_helpers:250: error: there are no arguments to 'dtostrf' that depend on a template parameter, so a declaration of 'dtostrf' must be available
/Applications/Arduino_1.5.6.app/Contents/Resources/Java/hardware/digistump/sam/libraries/StandardCplusplus/ostream_helpers:250: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
string_vector.ino: At global scope:
string_vector:13: error: no matching function for call to 'std::basic_oserialstream<char, std::char_traits, HardwareSerial>::basic_oserialstream(Serial
&)'
/Applications/Arduino_1.5.6.app/Contents/Resources/Java/hardware/digistump/sam/libraries/StandardCplusplus/serstream:230: note: candidates are: std::basic_oserialstream<charT, traits, Tserial>::basic_oserialstream(Tserial&) [with charT = char, traits = std::char_traits, Tserial = HardwareSerial]
/Applications/Arduino_1.5.6.app/Contents/Resources/Java/hardware/digistump/sam/libraries/StandardCplusplus/iosfwd:113: note: std::basic_oserialstream<char, std::char_traits, HardwareSerial>::basic_oserialstream(const std::basic_oserialstream<char, std::char_traits, HardwareSerial>&)

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

queue (and others) interrupt safe?

Hi,

I am trying to use this library to have a FIFO buffer for ISR's.
In the ISR I am calling the push() member function of a std::queue object like so:

struct STriggerRecord
{
   volatile int iSensorNumber;
   volatile int iSensorState;
   volatile unsigned long lTriggerTime;
};
std::queue<STriggerRecord> _STriggerQueue;
void RaceHandlerClass::TriggerSensor2()
{
   STriggerRecord S2Trigger;
   S2Trigger.lTriggerTime = micros();
   S2Trigger.iSensorNumber = 2;
   S2Trigger.iSensorState = digitalRead(_iS2Pin);;
   _STriggerQueue.push(S2Trigger);
}

However the last line of this code causes my arduino to freeze.
After I posted this question on arduino.stackexchange, I got a comment from someone who implies the freeze is caused by 'malloc() not being reentrant, and since the.push()` member function of a queue tries to allocate memory, it causes the freeze.

Is there any way around this? I really need a FIFO buffer for my ISR's, and wouldn't know how to achieve this other than using an std::queue container (or similar).

Library doesn't seem to work with Arduino Due

#include <utility.h>
#include <unwind-cxx.h>
#include <system_configuration.h>
#include <StandardCplusplus.h>
#include <vector>
#include <map>

std::vector<int> myvec;
std::map<String, int> mymap;

void setup()
{
  myvec.push_back(1);
  mymap["test"] = 2;
}

void loop() {}

When compiling for Arduno Due this gives the following error:

Arduino: 1.5.4 (Windows 7), Board: "Arduino Due (Programming Port)"

In file included from prova_cpp_due.ino:2:
C:\Users\andrea\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:176: error: ISO C++ forbids casting to an array type 'char [8]'
C:\Users\andrea\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:177: error: ISO C++ forbids casting to an array type 'char [8]'
C:\Users\andrea\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:178: error: ISO C++ forbids casting to an array type 'char [8]'
C:\Users\andrea\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:179: error: ISO C++ forbids casting to an array type 'char [8]'
C:\Users\andrea\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:180: error: ISO C++ forbids casting to an array type 'char [8]'
C:\Users\andrea\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:181: error: ISO C++ forbids casting to an array type 'char [8]'
C:\Users\andrea\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:182: error: ISO C++ forbids casting to an array type 'char [8]'
C:\Users\andrea\Documents\Arduino\libraries\StandardCplusplus/unwind-cxx.h:183: error: ISO C++ forbids casting to an array type 'char [8]'

Development status of this library

I was wondering what the status of this library is. I'd very much like to use this kind of stuff in my Arduino projects, especially the newer C++11 template stuff (so I was happy to find initializer_list was added). However, it seems that development is stalled / diverged a bit, so I'm wondering a few things. These questions are as much for @maniacbug, who I think initially created this library, as well as for @kibergus and @rpavlik, who have been making some significant changes in their forks AFAICS.

  • Are there any plans to update to a newer upstream version? Seems this repo contains uClibc++ 0.2.2, while there has been a 0.2.4 release in 2012, and some more activity in the git repo (most recently two months ago).
  • Are there any plans to submit changes back upstream? It seems there are some changes in this repository, and even more in the repositories of @kibergus and @rpavlik that could be useful for upstream uClibc++ as well, while at the same time reducing the maintenance burden for this Arduino port.
  • Are there any plans to merge the ports of @kibergus and @rpavlik into this one, or vice versa? Having a single canonical "latest version", as well as a single place to focus development effort might help in moving forward?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.