error in xutility when compiling

I'm moving my project from VS 6.0 to VS2008.  I can't build one DLL because of a series of errors that I don't understand.

This compiles without issue in Visual Studio 6.0, but gives this big mess in VS2008.   Can someone explain?  Thanks...

Errors are like:

c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(764) : error C2039: 'iterator_category' : is not a member of 'vec'
1>        c:\alphard\new_++\metron port\met3d9\Ops3D.h(11) : see declaration of 'vec'
1>        .\WarpDialog.cpp(429) : see reference to class template instantiation 'std::iterator_traits<_Iter>' being compiled

and it points into this code in xutility (which is a part of Vis Studio 9.0 include files):

            // TEMPLATE CLASS iterator_traits
template<class _Iter>
      struct iterator_traits
      {      // get traits from iterator _Iter
      typedef typename _Iter::iterator_category iterator_category;
      typedef typename _Iter::value_type value_type;
      typedef typename _Iter::difference_type difference_type;
      typedef difference_type distance_type;      // retained
      typedef typename _Iter::pointer pointer;
      typedef typename _Iter::reference reference;

Part of my problem is that I've never used Temmplates and don't understand what is going on here.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What is the code at c:\alphard\new_++\metron port\met3d9\Ops3D.h(11) and the other file?
tullheadAuthor Commented:
Attached is Ops3d.h which is referred to (for definition of "vec") and the code that uses "vec" that the error pointed to in WarpDialog.cpp is here below:

// Compare "p" to the cloud of points in "pKeys" and return the distance to the nearest one.
double mindistance(vec p, KeyPointArray* pKeys)
   int i,n;
   double dist, minsofar;
   minsofar = 1000000000.0;
   for (i=0;i<n; i++)
      vec vv = pKeys->GetAt(i).v;
      dist = distance(p,vv);
        if (dist < minsofar)
         minsofar = dist;
   return minsofar;
The problem seems to be the line

      dist = distance(p,vv);

Open in new window

where the compiler seems to mistakenly match your 'distance()' to 'std::distance()' (


      dist = ::distance(p,vv); // do indicate this is NOT 'std::distance()'

Open in new window

instead to indicate the correct scope.

BTW, does your '_WIN32_WINNT' problem stil persist or have you just forgotten about that Q?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

tullheadAuthor Commented:
Yes, thats it!  Thanks.  I will accept this as the solution as soon as EE lets me.  Something wonky -- have to log out and re-log-in before it lets me 'accept as solution' ??

On the _WIN32_WINNT problem -- haven't jumped on that yet - but will here soon...
>>have to log out and re-log-in before it lets me 'accept as solution' ??

Shouldn't be the case, but will let CS know...
That's whyt I got as a reply: "Without knowing specifics (browser, OS, etc) I couldn't begin to guess." - so, if you are wiing to provide that, we can move on a bit ;o)
tullheadAuthor Commented:
I'm not being specific, because I haven't figured out the pattern yet - but here is all I know at the moment:  I was on IE9 on a win7-64 PC and found I couldn't click on the "accept as answer" icon.  Logged out of EE and back in, but still couldn't.  Then went to XP SP3 machine running IE8 and logged in, and was able to click the icon and assign points.
Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.