Hi all,
I guess it's my turn to be the one asking questions
I wanted to try the STL library ported by Andy Brown.
http://arduino.cc/forum/index.php/topic,77555.0.html
The instructions on Andy's blog mentioned a pre-1.0 version of Arduino. I tried to use the lib under Arduino 1.0, though.
My platform is Ubuntu 11.10 x64. I managed to make Arduino see stl's .h file by putting them in /usr/lib/avr/include/
. In fact, to keep things clean, I copied Andy's .h in /usr/lib/avr/include/avr-stl, and symlinked its contents one by one to /usr/lib/avr/include/. This last bit should not make any difference, though...
When I compile a "bare minimum" with just one include I get many errors. I have activated the "verbose compilation" option.
Sketch:
// stl test
#include <vector>
void setup() {
}
void loop() {
}
Compilation errors:
avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I/home/marcello/Software/arduino-1.0/hardware/arduino/cores/arduino -I/home/marcello/Software/arduino-1.0/hardware/arduino/variants/standard /tmp/build8593065707036368931.tmp/BareMinimum.cpp -o/tmp/build8593065707036368931.tmp/BareMinimum.cpp.o
In file included from /usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_algobase.h:64:0,
        from /usr/lib/gcc/avr/4.5.3/../../../avr/include/vector:31,
        from BareMinimum.cpp:3:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:589:48: error: expected type-specifier before ‘char_traits’
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:589:48: error: expected ‘>’ before ‘char_traits’
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:595:11: error: ‘basic_istream’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:599:11: error: ‘_Dist’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:604:32: error: expected ‘)’ before ‘&’ token
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:623:3: error: ‘istream_type’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: In constructor ‘std::istream_iterator<_Tp, _CharT, _Traits>::istream_iterator()’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:603:24: error: class ‘std::istream_iterator<_Tp, _CharT, _Traits>’ does not have any field named ‘_M_stream’
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: In member function ‘bool std::istream_iterator<_Tp, _CharT, _Traits>::_M_equal(const std::istream_iterator<_Tp, _CharT, _Traits>&) const’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:620:49: error: ‘_M_stream’ was not declared in this scope
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: In member function ‘void std::istream_iterator<_Tp, _CharT, _Traits>::_M_read()’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:628:14: error: ‘_M_stream’ was not declared in this scope
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: At global scope:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:638:62: error: wrong number of template arguments (4, should be 3)
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:591:7: error: provided for ‘template<class _Tp, class _CharT, class _Traits> class std::istream_iterator’
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:639:62: error: wrong number of template arguments (4, should be 3)
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:591:7: error: provided for ‘template<class _Tp, class _CharT, class _Traits> class std::istream_iterator’
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:639:68: error: ‘bool std::operator==(const int&, const int&)’ must have an argument of class or enumerated type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:647:62: error: wrong number of template arguments (4, should be 3)
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:591:7: error: provided for ‘template<class _Tp, class _CharT, class _Traits> class std::istream_iterator’
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:648:62: error: wrong number of template arguments (4, should be 3)
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:591:7: error: provided for ‘template<class _Tp, class _CharT, class _Traits> class std::istream_iterator’
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:648:68: error: ‘bool std::operator!=(const int&, const int&)’ must have an argument of class or enumerated type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:655:48: error: expected type-specifier before ‘char_traits’
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:655:48: error: expected ‘>’ before ‘char_traits’
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:660:11: error: ‘basic_ostream’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:668:32: error: expected ‘)’ before ‘&’ token
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:669:32: error: expected ‘)’ before ‘&’ token
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:671:23: error: template argument 3 is invalid
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:676:23: error: template argument 3 is invalid
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:677:23: error: template argument 3 is invalid
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:678:23: error: template argument 3 is invalid
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:680:3: error: ‘ostream_type’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: In member function ‘int& std::ostream_iterator<_Tp, _CharT, _Traits>::operator=(const _Tp&)’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:672:6: error: ‘_M_stream’ was not declared in this scope
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: At global scope:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:699:11: error: ‘basic_streambuf’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:700:11: error: ‘basic_istream’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:703:37: error: expected ‘)’ before ‘*’ token
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:704:35: error: expected ‘)’ before ‘&’ token
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:725:16: error: ‘streambuf_type’ has not been declared
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:750:3: error: ‘streambuf_type’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: In member function ‘void std::istreambuf_iterator<_CharT, _Traits>::_M_init(int*)’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:726:5: error: ‘_M_buf’ was not declared in this scope
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: In member function ‘void std::istreambuf_iterator<_CharT, _Traits>::_M_nextc()’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:736:20: error: ‘_M_buf’ was not declared in this scope
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: In member function ‘void std::istreambuf_iterator<_CharT, _Traits>::_M_getc() const’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:743:20: error: ‘_M_buf’ was not declared in this scope
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: At global scope:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:806:11: error: ‘basic_streambuf’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:807:11: error: ‘basic_ostream’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:810:37: error: expected ‘)’ before ‘*’ token
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:811:35: error: expected ‘)’ before ‘&’ token
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:827:3: error: ‘streambuf_type’ does not name a type
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h: In member function ‘std::ostreambuf_iterator<_CharT, _Traits>& std::ostreambuf_iterator<_CharT, _Traits>::operator=(char_type)’:
/usr/lib/gcc/avr/4.5.3/../../../avr/include/stl_iterator.h:815:48: error: ‘_M_buf’ was not declared in this scope
Any pointers ? Thank you in advance!
(edit: added reference to Nick's page)