Solved

namespace conflict

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

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

22 Experts available now in Live!

Get 1:1 Help Now