Solved

Can't compile STL into Win32 Console App

Posted on 2004-04-01
2
211 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
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 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

17 Experts available now in Live!

Get 1:1 Help Now