I got the latest source code from the Celestia CVS and out of curiosity I tried to compile it under VC++6.0 in my Window XP.
I got the following errors
Code: Select all
--------------------Configuration: celengine - Win32 Release--------------------
Compiling...
render.cpp
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(583) : error C2784: 'bool __cdecl std::operator <(const class std::multimap<_K,_Ty,_Pr,_A> &,const class std::multimap<_K,_Ty,_Pr,_A> &)' : could not deduce template argument for 'const class std::mu
ltimap<_K,_Ty,_Pr,_A> &' from 'Renderer::Label'
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(548) : see reference to function template instantiation 'void __cdecl std::_Unguarded_insert(Renderer::Label *,Renderer::Label)' being compiled
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(583) : error C2784: 'bool __cdecl std::operator <(const class std::map<_K,_Ty,_Pr,_A> &,const class std::map<_K,_Ty,_Pr,_A> &)' : could not deduce template argument for 'const class std::map<_K,_Ty,_
Pr,_A> &' from 'Renderer::Label'
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(548) : see reference to function template instantiation 'void __cdecl std::_Unguarded_insert(Renderer::Label *,Renderer::Label)' being compiled
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(583) : error C2784: 'bool __cdecl std::operator <(const class std::_Tree<_K,_Ty,_Kfn,_Pr,_A> &,const class std::_Tree<_K,_Ty,_Kfn,_Pr,_A> &)' : could not deduce template argument for 'const class std
::_Tree<_K,_Ty,_Kfn,_Pr,_A> &' from 'Renderer::Label'
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(548) : see reference to function template instantiation 'void __cdecl std::_Unguarded_insert(Renderer::Label *,Renderer::Label)' being compiled
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(583) : error C2784: 'bool __cdecl std::operator <(const class std::vector<_Ty,_A> &,const class std::vector<_Ty,_A> &)' : could not deduce template argument for 'const class std::vector<_Ty,_A> &' fr
om 'Renderer::Label'
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(548) : see reference to function template instantiation 'void __cdecl std::_Unguarded_insert(Renderer::Label *,Renderer::Label)' being compiled
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(583) : error C2784: 'bool __cdecl std::operator <(const class std::basic_string<_E,_Tr,_A> &,const _E *)' : could not deduce template argument for 'const class std::basic_string<_E,_Tr,_A> &' from 'R
enderer::Label'
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(548) : see reference to function template instantiation 'void __cdecl std::_Unguarded_insert(Renderer::Label *,Renderer::Label)' being compiled
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(583) : error C2784: 'bool __cdecl std::operator <(const _E *,const class std::basic_string<_E,_Tr,_A> &)' : could not deduce template argument for 'const *' from 'Renderer::Label'
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(548) : see reference to function template instantiation 'void __cdecl std::_Unguarded_insert(Renderer::Label *,Renderer::Label)' being compiled
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(583) : error C2784: 'bool __cdecl std::operator <(const class std::basic_string<_E,_Tr,_A> &,const class std::basic_string<_E,_Tr,_A> &)' : could not deduce template argument for 'const class std::ba
sic_string<_E,_Tr,_A> &' from 'Renderer::Label'
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(548) : see reference to function template instantiation 'void __cdecl std::_Unguarded_insert(Renderer::Label *,Renderer::Label)' being compiled
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(583) : error C2784: 'bool __cdecl std::operator <(const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &,const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &)' : could not deduce template argumen
t for 'const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &' from 'Renderer::Label'
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(548) : see reference to function template instantiation 'void __cdecl std::_Unguarded_insert(Renderer::Label *,Renderer::Label)' being compiled
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(583) : error C2784: 'bool __cdecl std::operator <(const struct std::pair<_T1,_T2> &,const struct std::pair<_T1,_T2> &)' : could not deduce template argument for 'const struct std::pair<_T1,_T2> &' fr
om 'Renderer::Label'
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(548) : see reference to function template instantiation 'void __cdecl std::_Unguarded_insert(Renderer::Label *,Renderer::Label)' being compiled
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(583) : error C2676: binary '<' : 'Renderer::Label' does not define this operator or a conversion to a type acceptable to the predefined operator
C:\Microsoft Visual Studio\VC98\INCLUDE\algorithm(548) : see reference to function template instantiation 'void __cdecl std::_Unguarded_insert(Renderer::Label *,Renderer::Label)' being compiled
I believe it is due to the latest added code in render.c file
Code: Select all
bool operator<(const Renderer::Label& a, const Renderer::Label& b)
{
return a.position.z > b.position.z;
}
My question is: what is the significant difference it would make if the following definition in render.h file is placed outside the Renderer class? If it is define in such way, the above compiling errors could be gone-away.
Code: Select all
typedef struct {
std::string text;
Color color;
Point3f position;
} Label;
outside the Renderer class
Any help please?