Solved

Using STL in Visual C++

Posted on 2004-10-17
2
238 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
  • 2
2 Comments
 
LVL 19

Accepted Solution

by:
mrwad99 earned 100 total points
Comment Utility
Add "using namespace std"...

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

using namespace std;

HTH
0
 
LVL 19

Expert Comment

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

using std::list;
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now