Solved

namespace conflict

Posted on 2002-06-22
4
605 Views
Last Modified: 2013-12-03
I used STL and GDIplus in my program. I got a compilation error with the following declaration :

#include <gdiplus.h>
using namespace Gdiplus;
#include <vector>
using namespace std;


How do I resolve the compilation error ?

Thank you!
0
Comment
Question by:kctan100
[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
4 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7101508
>>a compilation error

Is it possible that you might be specific and say WHAT compiler error?  Or is this some sort of test?

>>How do I resolve the compilation error ?

Whatever you're doing wrong, FIX it!
0
 
LVL 7

Expert Comment

by:peterchen092700
ID: 7101971
What jhance is trying to tell you: We need more information to help you. What error(s) do you get?
0
 

Author Comment

by:kctan100
ID: 7102479
I got this error :

d:\program files\microsoft sdk\include\gdiplusflat.h(267) : error C2955: 'iterator' : use of class template requires template argument list
        d:\program files\microsoft visual studio\vc98\include\utility(71) : see declaration of 'iterator'
0
 
LVL 8

Accepted Solution

by:
fl0yd earned 50 total points
ID: 7102684
Don't use

"using namespace Gdiplus;" and
"using namespace std;"

Resolve the namespaces manually when you actually need to. For example, write
std::vector<int> int_vector;
instead of
vector<int> int_vector;

If you cannot go without your "using ..."-directives at least place them AFTER all your includes. These directives are in effect from the line they are first discovered to the end of the file.

Did that solve your problems?
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Query performance - SQL Server 20 85
What is UAC Virtualization in the Process (TASK) Manager? 4 4,820
File Watcher and Deleter with Email notification 5 140
Using MS Code on my Mac 6 78
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

751 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