Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Using STL in Visual C++

Posted on 2004-10-17
2
Medium Priority
?
257 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 400 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

Technology Partners: 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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

647 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