compile error trying to use stl list

I’ve managed to get the include files kindly provided by Andy Brown located where the compiler finds them but I am having trouble compiling something. I’ve stripped it down to a minimal example:

#include <iterator>
#include <list>
#include <pnew.cpp>

using namespace std;

list<int> intlist;

void setup(){
}

void loop(){}

which produces the following diagnostic:

sketch_apr04b:7: error: expected constructor, destructor, or type conversion before ‘<’ token

The code (with minor mods to accommodate different coding environment) compiles w/out error on Linux. Is there a way to get this to compile for the Arduino?

thanks,
hank

I get the same error if I don't install the header files but your example compiles fine as soon as I install the header files. Maybe you got the wrong location as my path is different from the one described in the blog article: "hardware/tools/avr/lib/avr/include/".

That’s entirely possible. Before this I had errors with the include files not found. I wonder why you did not see that without headers installed.

Where did you install the headers? I put the headers in …/arduino-1.0.5/libraries/stl (e.g. /arduino-1.0.5/libraries/stl/list for "#include " That seemed to follow the pattern that the built in libraries followed.

thanks

Before this I had errors with the include files not found. I wonder why you did not see that without headers installed.

I did but I got your error too and I did not try without verbose output.

Where did you install the headers? I put the headers in …/arduino-1.0.5/libraries/stl (e.g. /arduino-1.0.5/libraries/stl/list for "#include " That seemed to follow the pattern that the built in libraries followed.

That’s not a standard Arduino library so you cannot install it in the libraries folder. As I wrote, I installed them in “hardware/tools/avr/lib/avr/include/” (I have a Linux system, your path may vary).

pylon: That's not a standard Arduino library so you cannot install it in the libraries folder.

I see. I was not aware of that.

As I wrote, I installed them in "hardware/tools/avr/lib/avr/include/" (I have a Linux system, your path may vary).

Yes, literally. The header files themselves went into that directory (along with some system headers) and that seems to have fixed the problem. On my system (also Linux) the full path is: /home/hbarta/arduino-1.0.5/hardware/tools/avr/lib/avr/include/include That makes me wonder why Andy Brown had the files in a directory structure. Perhaps he had a different build environment.

Thank you for your help.