I must be missing something basic....

I am evaluating 6.3, and I can’t get the proverbial 3 liner to compile:

#include <list>
#include <string>
#include <iostream>
using namespace std;

int main(void)
{
  list<string *> foo;
  string         bar("BAR");

  foo.push_back(new string(bar));

  cout << *(*(foo.begin())) << endl;
}

compiled with:

QCC -V3.3.1,gcc_ntox86 -o list list.cc

Errors:

/usr/qnx630/target/qnx6/usr/include/cpp/list: In instantiation of std::list&lt;std::string*, std::allocator&lt;std::string*&gt; &gt;::const_iterator': /usr/qnx630/target/qnx6/usr/include/cpp/list:456: instantiated from std::list<std::string*, std::allocator<std::string*> >::iterator’
/usr/qnx630/target/qnx6/usr/include/cpp/list:456: instantiated from
std::list&lt;_Ty, _Ax&gt;::iterator std::list&lt;_Ty, _Ax&gt;::end() [with _Ty = std::string*, _Ax = std::allocator&lt;std::string*&gt;]' /usr/qnx630/target/qnx6/usr/include/cpp/list:552: instantiated from void std::list<_Ty, _Ax>::push_back(const _Ty&) [with _Ty = std::string*,
_Ax = std::allocator<std::string*>]’
list.cc:11: instantiated from here
/usr/qnx630/target/qnx6/usr/include/cpp/list:74: error: typedef class std::allocator&lt;std::string*&gt; std::_List_val&lt;std::string*, std::allocator&lt;std::string*&gt; &gt;::_Alty' is protected /usr/qnx630/target/qnx6/usr/include/cpp/list:456: error: within this context /usr/qnx630/target/qnx6/usr/include/cpp/list:74: error: typedef class
std::allocator<std::string*> std::_List_val<std::string*,
std::allocator<std::string*> >::_Alty’ is protected
/usr/qnx630/target/qnx6/usr/include/cpp/list:456: error: within this context
/usr/qnx630/target/qnx6/usr/include/cpp/list:74: error: `typedef class
std::allocator<std::string*> std::_List_val<std::string*,
std::allocator<std::string*> >::_Alty’ is protected
/usr/qnx630/target/qnx6/usr/include/cpp/list:456: error: within this context
cc: /usr/qnx630/host/qnx6/x86/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.1/cc1plus error 1

What am I doing wrong ?

Needless to say the preceding compiles (and even works) on 6.2.1 with the following compiler invocation:

QCC -olist list.cc

Garry answered this in a separate thread.

I am copying it here:

Thanks noc…