Re: VC6 -> VC2005 conversion problem



Philippe wrote:
Hello,

I'm converting my project from VC++6 to VC++2005.
among many compilation errors now solved, that one is stucking me :

I have that template :

<snip>

the faulty code is :

void CPGLLine2DLOD::PlotLineStripGfx(gfxinterface::CGfxInterface& gfx)
{
const LODLine::KeyContainer& kc= m_hull.GetKeys();
LODLine::KeyContainer::const_iterator it;
UINT i;
double* pX=new double[kc.size()];
double* pY=new double[kc.size()];
for (it=kc.begin(), i=0; it!=kc.end();it++, i++)
{
// line (174) in error
pX[i] = (*it)->x;
// idem
pY[i] = (*it)->y;
}

}

I get that compilation error :

c:\program files\microsoft visual studio 2005\vc\pgl\pglline2dlod.cpp(174) : error C2819: type 'std::vector<_Ty>' does not have an overloaded member 'operator ->'
with
[
_Ty=hull::TLineApproximator<double>::SPoint
]
did you intend to use '.' instead?
c:\program files\microsoft visual studio 2005\vc\pgl\pglline2dlod.cpp(174) : error C2039: 'x' : is not a member of 'std::vector<_Ty>'
with
[
_Ty=hull::TLineApproximator<double>::SPoint
]


Strange, it compiled perfectly under VC6 and it's now faulty under VC2005
What norm change is responsible with that error and how to correct it ?

Philippe:

Well, it looks wrong to me. Don't you mean

pX[i] = it->x;
pY[i] = it->y;

Are you sure this compiled and worked in VC6?

--
David Wilkinson
Visual C++ MVP
.



Relevant Pages

  • RE: Compiling a Program
    ... Barring any compilation errors, an executable (if ... 'bin' directory in the folder where your project file is located. ... SDET Visual Studio ... >I was wondering if in Acedemic edition can i make my program an executable ...
    (microsoft.public.dotnet.academic)
  • #include <vcclr.h>
    ... Every time I try to include vcclr.h I get bizarre compilation errors. ... In Visual Studio .NET 2003, ... I'm trying to reword and clarify) ...
    (microsoft.public.dotnet.languages.vc)
  • build errors not displayed
    ... Visual Studio .NET 2003. ... I can display the compilation errors by opening ... The Task List Panel no tasks, The title contains the following text: ...
    (microsoft.public.vsnet.ide)
  • VC7.1 to VC8 ATL Compilation errors
    ... Just attempted to "migrate" a project from VC7.1 to VC8. ... Got over 1300 compilation errors in the ATL headers contained in Program ...
    (microsoft.public.vc.atl)
  • Really basic MC++ compilation error
    ... In Visual Studio .NET 2003, ... I get the following compilation errors: ... I must say, that so far, converting to Managed C++ has been very ... has such widely touted compatibility with. ...
    (microsoft.public.dotnet.languages.vc)