List is part of the std namespace. There are two ways to solve your problem:
After your include(s), add:
Then your code should work fine. Alternatively, replace line 8 with:
Either way works, but if you use the second method, every usage of list/vector/cout/etc will require you to put std:: in front of the word. If you plan to use a lot of things from the std namespace, you might as well use the first method.