Solved

Using STL in Visual C++

Posted on 2004-10-17
2
247 Views
Last Modified: 2013-12-14
Here is my code:
=========BEGIN CODE=========
#include "stdafx.h"
#include <list>

int main(int argc, char* argv[])
{
      list<int> coordList;

      return 0;
}
=========END CODE=========

Here are my compile errors:
=========BEGIN ERRORS=========
--------------------Configuration: Life - Win32 Debug--------------------
Compiling...
Life.cpp
D:\Source Code\Life\Life.cpp(39) : error C2065: 'list' : undeclared identifier
D:\Source Code\Life\Life.cpp(39) : error C2062: type 'int' unexpected
Error executing cl.exe.

Life.exe - 2 error(s), 0 warning(s)
=========END ERRORS=========

I'm convinced it's something simple to fix, but I haven't the foggiest what it could be.   Any help is, as always, appreciated.
0
Comment
Question by:Diceman_01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 19

Accepted Solution

by:
mrwad99 earned 100 total points
ID: 12333362
Add "using namespace std"...

#include "stdafx.h"
#include <list>

using namespace std;

HTH
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 12333365
Alternatively, to prevent importing the whole of the standard namespace, you could just add

using std::list;
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question