Error on MSVC7 compilation for 1.2.1

When I use makepanda or ppremake I get always the next error

g:\Engines\panda3d-1.2.1\panda3d-1.2.1\panda\src\gobj\geom.cxx(1278) : error C25
93: ‘operator ==’ is ambiguous
could be ‘built-in C++ operator==(PointerToBase::To *, PointerToBase<
T>::To *)’
with
[
T=Geom::CacheEntry
]
and
[
T=Geom::CacheEntry
]
or ‘built-in C++ operator==(Geom::CacheEntry *const , Geom::CacheE
ntry *const )’
while trying to match the argument list ‘(PointerTo, Geom::CacheEntry
*const )’
with
[
T=Geom::CacheEntry
]
g:\Engines\panda3d-1.2.1\panda3d-1.2.1\panda\src\gobj\geomVertexData.cxx(1758) :
error C2593: ‘operator ==’ is ambiguous
could be ‘built-in C++ operator==(PointerToBase::To *, PointerToBase<
T>::To *)’
with
[
T=GeomVertexData::CacheEntry
]
and
[
T=GeomVertexData::CacheEntry
]
or ‘built-in C++ operator==(GeomVertexData::CacheEntry *const , GeomVertexData::CacheEntry *const )’
while trying to match the argument list ‘(PointerTo, GeomVertexData::
CacheEntry *const )’
with
[
T=GeomVertexData::CacheEntry
]

How very odd. You must have a subtly different version of MSVC7 than we have.

Try changing line 1278 of geom.cxx from:


  nassertv((*ci) == this);

To:


  nassertv((*ci).p() == this);

David

I did it, and works but now another error:

g:\Engines\panda3d-1.2.1\panda3d-1.2.1\panda\src\pgraph\cullPlanes.cxx(170) : er
ror C2593: ‘operator !=’ is ambiguous
could be ‘built-in C++ operator!=(const PointerToBase::To *, const Po
interToBase::To *)’
with
[
T=CullPlanes
]
and
[
T=CullPlanes
]
or ‘built-in C++ operator!=(const CullPlanes *const , const CullPl
anes *const )’
while trying to match the argument list ‘(ConstPointerTo, const CullP
lanes *const )’
with
[
T=CullPlanes
]

In this case, change:


nassertr(new_planes != this, new_planes);

to:


nassertr(new_planes.p() != this, new_planes);

There will probably be a smattering of similar changes you will have to make throughout the codebase. If you are willing to do this, go ahead and make the necessary changes as you come across them; and then you can send me a patch file that shows all of the changes you have made, and I will apply it to the tree.

David

I fix some others code error, and get a new one of compiler settings

g:\Engines\panda3d-1.2.1\panda3d-1.2.1\built\include\deletedChain.T(24) : fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit

Hm. This is just weird. What versions of visual studio do you have installed?

Also, just so you know: microsoft visual toolkit 2003 can compile the current release. It’s a free download, so maybe it’s easier to just download it and use it than to try to fix this.

If you are using the ppremake build system without Cygwin, edit dtool/pptempl/Global.nmake.pp. Search for /Zm, and change:


#defer extra_cflags /EHsc /Zm300 /DWIN32_VC /DWIN32=1 $[WARNING_LEVEL_FLAG] $[END_CFLAGS]

To:


#defer extra_cflags /EHsc /Zm500 /DWIN32_VC /DWIN32=1 $[WARNING_LEVEL_FLAG] $[END_CFLAGS]

Or maybe higher if necessary–but I think it is an oversight that this value is currently set to 300 (it should be at least 500).

If you are using the ppremake build system with Cygwin, the file to change is dtool/pptempl/Global.gmsvc.pp. If you are using makepanda, change:


    cmd = cmd + " /EHsc /Zm300 /DWIN32_VC /DWIN32 /W3 " + fullsrc

to:


    cmd = cmd + " /EHsc /Zm500 /DWIN32_VC /DWIN32 /W3 " + fullsrc

David