problem compiling plsm in vc2005

cyc

16-12-2005 03:15:27

Hi,
Ogre 1.0.6 SDK works fine but I get some error messages when I try to compile the plsm sdk version.

Any idea what went wrong?

OgrePagingLandScapeOcclusionSWTraversal.cpp
E:\Programme\Microsoft Visual Studio 8\VC\include\xutility(323) : error C2664: 'bool Ogre::FrontToBackNodeSorterOperator::operator ()(const Ogre::OcclusionElement *&,const Ogre::OcclusionElement *&) const' : cannot convert parameter 1 from 'Ogre::OcclusionElement *' to 'const Ogre::OcclusionElement *&'
Conversion loses qualifiers
E:\Programme\Microsoft Visual Studio 8\VC\include\algorithm(1676) : see reference to function template instantiation 'bool std::_Debug_lt_pred<_Pr,Ogre::OcclusionElement*,Ogre::OcclusionElement*>(_Pr,_Ty1 &,_Ty2 &,const wchar_t *,unsigned int)' being compiled
with
[
_Pr=Ogre::FrontToBackNodeSorterOperator,
_Ty1=Ogre::OcclusionElement *,
_Ty2=Ogre::OcclusionElement *
]

tuan kuranes

16-12-2005 14:30:58

express or other version ?

try removing the & and the const ?
from

(const Ogre::OcclusionElement *&,const Ogre::OcclusionElement *&) const

to

(Ogre::OcclusionElement *, Ogre::OcclusionElement *) const

cyc

16-12-2005 15:05:30

hmm can't get this to work.
Should be a full blown vc2005 professional (as a student I got it for free from a msdn academic program).
I remember that I had a similar problem and error messages a few weeks ago with std::swap.
I wasn't able to compile my game engine written in vc2003 with the new vc2005 and i had nearly identical error messages (always in template instantiations that in my case used std::swap).
The strange this is, that when I took this peace of code out into a new project it compiled flawlessly. Already asked ms for support but they couldn't reproduce it.
Any ideas before I completly reinstall windows and vc2005?

tuan kuranes

16-12-2005 15:22:48

CVS code has 2 flavor try paste these instead of actual SDK code :

//-----------------------------------------------------------------------
inline bool operator()(OcclusionElement*& a, OcclusionElement*& b) const
{
// could check if both distance == 0 then order visible first// ?
return vectorToBoxDistance (*a, pos) > vectorToBoxDistance (*b, pos);
}
//-----------------------------------------------------------------------
inline bool operator()(const OcclusionElement*& a, const OcclusionElement*& b) const
{
// could check if both distance == 0 then order visible first ?
return vectorToBoxDistance (*a, pos) > vectorToBoxDistance (*b, pos);
}

cyc

16-12-2005 15:48:39

Thanx!
compiles fine now.