you probably have forgotten the using namespace std;
in your cpp file so as to have access to the definition of list
that resides into the std
namespace.
personnaly I prefer not to use using namespace std;
and I use std::list
rather of list
in my cpp files
std::list<Element> myList;
myList.push_back(anElement);