SmoothMover compile-time error

Hi,

I’ve just gotten this error:

cl /Fobuilt/tmp/deadrec_composite.obj /nologo /c /I"C:/Programme/Microsoft Direc
tX SDK (August 2006)/Include" /Ithirdparty/win-python/include /Ithirdparty/win-l
ibs-vc7/nspr/include /Ibuilt/tmp /Idirect/src/deadrec /Ibuilt/include /Zc:forSco
pe /MD /Zi /O2 /Ob2 /DFORCE_INLINING  /Fdbuilt/tmp/deadrec_composite.pdb /DBUILD
ING_DIRECT /EHsc /Zm300 /DWIN32_VC /DWIN32 /W3 direct/src/deadrec/deadrec_compos
ite.cxx
deadrec_composite.cxx
<localPandaHome>\panda3d\built\include\circBuffer.h(68) : error C2248
: 'SmoothMover::SamplePoint' : cannot access private class declared in class 'Sm
oothMover'
        c:\cygwin\home\max\pandacvs\panda3d\direct\src\deadrec\smoothMover.h(160
) : see declaration of 'SmoothMover::SamplePoint'
        c:\cygwin\home\max\pandacvs\panda3d\direct\src\deadrec\smoothMover.h(50)
 : see declaration of 'SmoothMover'
        This diagnostic occurred in the compiler generated function 'CircBuffer<
Thing,max_size>::CircBuffer(const CircBuffer<Thing,max_size> &)'
        with
        [
            Thing=SmoothMover::SamplePoint,
            max_size=10
        ]

A quick glance shows that inside smoothMover.h the SamplePoint class (could really be a struct) is privately declared (inside SmoothMover class) and the Points typedef references it as a type argument for CircBuffer. It seems that the compiler while generating the copy constructor for this template instantiation needs access to SamplePoint. (Probably for calling in turn the copy constructor of SamplePoint).

Any ideas?

Thanks,
Max Hajek

Some compilers seem to be more fussy about references to private classes than others. I just checked in a trivial fix that declares this nested class to be public, which should work around the problem.

David

Hi David,

thanks again!

That was what I thought to be the obvious solution, too, but I was not sure whether this would be what you guys want.

I’m getting closer and closer to a successful build - cool!

BTW, in the “interrogate crash” thread there’s a patch for globpattern.cxx - originally I had put the patch for the wrong file there, but that’s been corrected. Maybe you want to take a look at it.

Thanks for all your work,
Max Hajek