Solved

namespace conflict

Posted on 2002-06-22
4
602 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
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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