Andy Brown's STL port and Arduino 1.0 [solved]

Hi all,
I guess it's my turn to be the one asking questions :stuck_out_tongue:

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)

I mention on my page you need to include "iterator" or you will get errors. Which you did. This compiles under 1.0 of the IDE:

// stl test

#include <iterator>
#include <vector>

void setup() {
}

void loop() {
}

Now let's take it out for a drive ...

// stl test

#include <iterator>
#include <string>
#include <vector>
#include <serstream>

using namespace std;

ohserialstream serial(Serial);
    
// placement new
void * operator new (size_t size, void * ptr) { return ptr; }

void showv (const string s, const vector<string> & v)
  {
  serial << s << endl;
  copy(v.begin(), v.end(), ostream_iterator<string>(serial, " "));
  serial << endl << endl;
  } // end of showv
  
// case-independent (ci) string less_than
// returns true if s1 < s2
struct ci_less : binary_function<string, string, bool>
  {

  // case-independent (ci) compare_less binary function
  struct nocase_compare : public binary_function<unsigned char,unsigned char,bool> 
    {
    bool operator() (const unsigned char& c1, const unsigned char& c2) const 
      { return tolower (c1) < tolower (c2); }
    };

  bool operator() (const string & s1, const string & s2) const
    {
  
    return lexicographical_compare 
          (s1.begin (), s1.end (),   // source range
           s2.begin (), s2.end (),   // dest range
                nocase_compare ());  // comparison
    }
  }; // end of ci_less


void setup() {
  
  Serial.begin (115200);
  
   // vector of strings
  vector<string> v;

  // make a back insert iterator to safely add to the back of the vector
  back_insert_iterator<vector<string> > i(v);
  
// Insert items into the vector. 
// Strictly speaking, the "++" is not needed, as the
// assignment to the iterator is what advances it.

  *i++ = "The";
  *i++ = "quick";
  *i++ = "brown";
  *i++ = "fox";
  *i++ = "jumped";
  *i++ = "over";
  *i++ = "the";
  *i++ = "lazy";
  *i++ = "dog";

  showv ("initial vector...", v);

  // sort ascending
  sort (v.begin (), v.end ());
  showv ("after sort (ascending)...", v);

  // sort descending by using greater function to compare less
  sort (v.begin (), v.end (), greater<string> ());
  showv ("after sort (descending)...", v);

  // sort case-independent by using our own compare-less
  sort (v.begin (), v.end (), ci_less ());
  showv ("after case-independent sort (ascending)...", v);

  // reverse that by doing a "not" on the result
  sort (v.begin (), v.end (), not2 (ci_less ()));
  showv ("after case-independent sort (descending)...", v);
 
  // shuffle the words
  random_shuffle (v.begin (), v.end ());
  showv ("after shuffle...", v);

  // rotate them
  rotate (v.begin (), v.begin () + 1, v.end ());
  showv ("after rotate 1 to the left...", v);

  // reverse their order
  reverse (v.begin (), v.end ());
  showv ("after reverse...", v);

  // add "(" to the beginning of each one
  transform (v.begin (), v.end (),
             v.begin (),
             bind1st (plus<string> (), "("));

  // add ")" to the end of each one
  transform (v.begin (), v.end (),
             v.begin (),
             bind2nd (plus<string> (), ")"));
  showv ("after transforms...", v);

} // end of setup

void loop() { }

(Edit) Modified to use the serstream class rather than Serial.print.

Output:

initial vector...
The quick brown fox jumped over the lazy dog 

after sort (ascending)...
The brown dog fox jumped lazy over quick the 

after sort (descending)...
the quick over lazy jumped fox dog brown The 

after case-independent sort (ascending)...
brown dog fox jumped lazy over quick the The 

after case-independent sort (descending)...
The the quick over lazy jumped fox dog brown 

after shuffle...
dog over brown the lazy quick The fox jumped 

after rotate 1 to the left...
over brown the lazy quick The fox jumped dog 

after reverse...
dog jumped fox The quick lazy the brown over 

after transforms...
(dog) (jumped) (fox) (The) (quick) (lazy) (the) (brown) (over)

Note that I also needed to include "placement new" to make it compile. Funnily enough I made a post in another thread today about how they included new and delete in the 1.0 version of the IDE but not placement new.

I also have a different take on the STL, having ported uClibc++ to Arduino: GitHub - maniacbug/StandardCplusplus: Standard C++ for Arduino (port of uClibc++)

Works with 1.0, and uses Andy Brown's excellent serstream class.

So what's the difference between your version and Andy Brown's?

Damn! I read that bit but then forgot about it while trying to find a place for the lib... thank you!
:slight_smile:

Andy started with the original SGI STL, and did some more work to optimize for very low memory. I started with uClibc++ which itself is a port of the more modern GNU Standard C++. The differences are pretty esoteric. Most code that uses Standard C++ will port more easily using my stuff. This is why I brought it over in the first place. The unit test framework I use (cxxtest) needed a fuller implementation. His probably generates a bit tighter code just from the looks of it, though I haven't profiled it.

Hi,
I do also use the STL of Andy and get compiler errors which I do not understand. Maybe sb else sees the error? I do not understand why he has problems with the iterator... Thanks for any tips!

My Code looks like this:

//parser_event.ino
#include <vector>
#include <iterator>
#include <pnew.cpp>
....
std::vector<Event> *events;  //holds all events
	
	void sampleMethod() {
	...
		Event *myEvent = events[i]; //.at(i); did not work
	...
	}

Results in (no specific line is marked in the IDE):

In file included from avr/lib/gcc/../../avr/include/stl_algobase.h:64,
from avr/lib/gcc/../../avr/include/vector:31,
from parser_event.cpp:5:
avr/lib/gcc/../../avr/include/stl_iterator.h:589: error: expected type-specifier before 'char_traits'
avr/lib/gcc/../../avr/include/stl_iterator.h:589: error: expected '>' before 'char_traits'
avr/lib/gcc/../../avr/include/stl_iterator.h:595: error: expected ';' before '<' token
avr/lib/gcc/../../avr/include/stl_iterator.h:599: error: '_Dist' does not name a type
avr/lib/gcc/../../avr/include/stl_iterator.h:604: error: expected )' before '&' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h:623: error: expected ';' before '*' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h: In constructor 'std::istream_iterator<_Tp, _CharT, _Traits>::istream_iterator()': <path>avr/lib/gcc/../../avr/include/stl_iterator.h:603: error: class 'std::istream_iterator<_Tp, _CharT, _Traits>' does not have any field named '_M_stream' <path>avr/lib/gcc/../../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': <path>avr/lib/gcc/../../avr/include/stl_iterator.h:620: error: '_M_stream' was not declared in this scope <path>avr/lib/gcc/../../avr/include/stl_iterator.h: In member function 'void std::istream_iterator<_Tp, _CharT, _Traits>::_M_read()': <path>avr/lib/gcc/../../avr/include/stl_iterator.h:628: error: '_M_stream' was not declared in this scope <path>avr/lib/gcc/../../avr/include/stl_iterator.h: At global scope: <path>avr/lib/gcc/../../avr/include/stl_iterator.h:638: error: wrong number of template arguments (4, should be 3) <path>avr/lib/gcc/../../avr/include/stl_iterator.h:591: error: provided for 'template<class _Tp, class _CharT, class _Traits> class std::istream_iterator' <path>avr/lib/gcc/../../avr/include/stl_iterator.h:639: error: wrong number of template arguments (4, should be 3) <path>avr/lib/gcc/../../avr/include/stl_iterator.h:591: error: provided for 'template<class _Tp, class _CharT, class _Traits> class std::istream_iterator' <path>avr/lib/gcc/../../avr/include/stl_iterator.h:639: error: 'bool std::operator==(const int&, const int&)' must have an argument of class or enumerated type <path>avr/lib/gcc/../../avr/include/stl_iterator.h:647: error: wrong number of template arguments (4, should be 3) <path>avr/lib/gcc/../../avr/include/stl_iterator.h:591: error: provided for 'template<class _Tp, class _CharT, class _Traits> class std::istream_iterator' <path>avr/lib/gcc/../../avr/include/stl_iterator.h:648: error: wrong number of template arguments (4, should be 3) <path>avr/lib/gcc/../../avr/include/stl_iterator.h:591: error: provided for 'template<class _Tp, class _CharT, class _Traits> class std::istream_iterator' <path>avr/lib/gcc/../../avr/include/stl_iterator.h:648: error: 'bool std::operator!=(const int&, const int&)' must have an argument of class or enumerated type <path>avr/lib/gcc/../../avr/include/stl_iterator.h:655: error: expected type-specifier before 'char_traits' <path>avr/lib/gcc/../../avr/include/stl_iterator.h:655: error: expected '>' before 'char_traits' <path>avr/lib/gcc/../../avr/include/stl_iterator.h:660: error: expected ';' before '<' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h:668: error: expected )' before '&' token
avr/lib/gcc/../../avr/include/stl_iterator.h:669: error: expected )' before '&' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h:671: error: template argument 3 is invalid <path>avr/lib/gcc/../../avr/include/stl_iterator.h:676: error: template argument 3 is invalid <path>avr/lib/gcc/../../avr/include/stl_iterator.h:677: error: template argument 3 is invalid <path>avr/lib/gcc/../../avr/include/stl_iterator.h:678: error: template argument 3 is invalid <path>avr/lib/gcc/../../avr/include/stl_iterator.h:680: error: expected ';' before '*' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h: In member function 'int& std::ostream_iterator<_Tp, _CharT, _Traits>::operator=(const _Tp&)': <path>avr/lib/gcc/../../avr/include/stl_iterator.h:672: error: '_M_stream' was not declared in this scope <path>avr/lib/gcc/../../avr/include/stl_iterator.h: At global scope: <path>avr/lib/gcc/../../avr/include/stl_iterator.h:699: error: expected ';' before '<' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h:700: error: expected ';' before '<' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h:703: error: expected )' before '' token
avr/lib/gcc/../../avr/include/stl_iterator.h:704: error: expected )' before '&' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h:725: error: 'streambuf_type' has not been declared <path>avr/lib/gcc/../../avr/include/stl_iterator.h:750: error: expected ';' before '*' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h: In member function 'void std::istreambuf_iterator<_CharT, _Traits>::_M_init(int*)': <path>avr/lib/gcc/../../avr/include/stl_iterator.h:726: error: '_M_buf' was not declared in this scope <path>avr/lib/gcc/../../avr/include/stl_iterator.h: In member function 'void std::istreambuf_iterator<_CharT, _Traits>::_M_nextc()': <path>avr/lib/gcc/../../avr/include/stl_iterator.h:736: error: '_M_buf' was not declared in this scope <path>avr/lib/gcc/../../avr/include/stl_iterator.h: In member function 'void std::istreambuf_iterator<_CharT, _Traits>::_M_getc() const': <path>avr/lib/gcc/../../avr/include/stl_iterator.h:743: error: '_M_buf' was not declared in this scope <path>avr/lib/gcc/../../avr/include/stl_iterator.h: At global scope: <path>avr/lib/gcc/../../avr/include/stl_iterator.h:806: error: expected ';' before '<' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h:807: error: expected ';' before '<' token <path>avr/lib/gcc/../../avr/include/stl_iterator.h:810: error: expected )' before '
' token
avr/lib/gcc/../../avr/include/stl_iterator.h:811: error: expected `)' before '&' token
avr/lib/gcc/../../avr/include/stl_iterator.h:827: error: expected ';' before '*' token
avr/lib/gcc/../../avr/include/stl_iterator.h: In member function 'std::ostreambuf_iterator<_CharT, _Traits>& std::ostreambuf_iterator<_CharT, _Traits>::operator=(_CharT)':
avr/lib/gcc/../../avr/include/stl_iterator.h:815: error: '_M_buf' was not declared in this scope

Note: I replaced a part of the filepath with here for better readability

P.s.: Should I have opend another Thread for this?

@milkman

Change around the order of your includes for vector and iterator so that iterator comes first.

[quote author=Andy Brown link=topic=95443.msg780300#msg780300 date=1335959189]Change around the order of your includes for vector and iterator so that iterator comes first.
[/quote]
Holy Moly! I really searched for quite a long time for a solution - thank you very much Andy!

Is there clue in the error msgs of gcc/ anything general with C(++) to find a solution for such a problem in general. I mean: how to find out what's wrong in such a case? Is it 'magic knowledge' or anything obious?

Thanks again :slight_smile:

The clue is here:

In file included from <path>avr/lib/gcc/../../avr/include/stl_algobase.h:64,
                 from <path>avr/lib/gcc/../../avr/include/vector:31,
                 from parser_event.cpp:5:
<path>avr/lib/gcc/../../avr/include/stl_iterator.h:589: error: expected type-specifier before 'char_traits'

Apart from your own code the first error is raised from (2nd line above) and it mentions something to do with "stl_iterator". And in particular "expected type-specifier ".

So I would be thinking: "when it is processing it doesn't seem to know about ... perhaps I should put iterator first."

[quote author=Nick Gammon link=topic=95443.msg780857#msg780857 date=1335991077][...]
So I would be thinking: "when it is processing it doesn't seem to know about ... perhaps I should put iterator first."
[/quote]
Thank you very much for your explaination! Good points, next time I'll try to read the error messages in such a way. :slight_smile:

Anyone have used the STL on Arduino Due with Arduino IDE?

For anyone just getting into Arduino programming as I am and are having issues with using vector and/or stl_iterator.h from Andy Brown's STL port Version 1.1.1 with Arduino IDE 1.6.5 I found the following couple of fixes did the trick.

  1. Found this elsewhere (Disqus Profile - pecacheu) for vector: _M_deallocate on line 117 to this->_M_deallocate

  2. Add #include at line 31 of stl_iterator.h, exampled as follows

#ifndef __SGI_STL_INTERNAL_ITERATOR_H
#define __SGI_STL_INTERNAL_ITERATOR_H
#include
__STL_BEGIN_NAMESPACE

which solves the copious amount of errors being generated in that header.
BTW: I've seen some posts that would indicate that there might be a need to include the iterator header before the vector header when using the vector; that does not seem necessary, at least not anymore if it ever was.

Hope this helps someone, as for me, the only errors showing up now are coming out of my code. :slight_smile:

Additionally I also had to specify this to _M_put_node in stl_tree.h; i.e replace _M_put_node by this->_M_put_node in lines 494 and 508 in stl_tree.h