Solved

Can't compile STL into Win32 Console App

Posted on 2004-04-01
2
226 Views
Last Modified: 2013-11-20
Hi.  I am trying to add the std::map and std::string types to my project.  All I did was add the following to the top of one of my header files:

#include <string>
#include <map>
using namespace std;

I get hundereds of errors and warning. Some of the errors look like:

warning C4002: too many actual parameters for macro 'move'
c:\program files\microsoft visual studio\vc98\include\iosfwd(110) : error C2061: syntax error : identifier 'stdscr'
        c:\program files\microsoft visual studio\vc98\include\iosfwd(135) : see reference to class template instantiation 'std::char_traits<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\iosfwd(159) : warning C4002: too many actual parameters for macro 'move'
c:\program files\microsoft visual studio\vc98\include\iosfwd(159) : error C2061: syntax error : identifier 'stdscr'
c:\program files\microsoft visual studio\vc98\include\iosfwd(198) : warning C4002: too many actual parameters for macro 'move'
c:\program files\microsoft visual studio\vc98\include\iosfwd(198) : error C2061: syntax error : identifier 'stdscr'
etc................

Does anybody have any idea why this would happen?  Thanks.
0
Comment
Question by:mromeo
[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 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 10733425
Mixing MFC and STL can be a major headache. See http://support.microsoft.com/default.aspx?scid=kb;en-us;143207 ("PRB: Common Problems When Using STL with STD Namespace") and the ALLINONE sample at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/_sample_com_allinone.asp 
0
 

Author Comment

by:mromeo
ID: 10734843
Ok.. I found the problem.  It was the order in which I was including things.  I was including some PDCurses header files and I needed to include those after the STL includes.  Thanks for your help
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

627 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