Problem Compiling CEGUI Under VC10
Posted: Tue Jul 21, 2009 12:25
Trying to get CEGUI compiling under VC10 but not having much luck. I know this won't be officially supported, but I figured someone might have a fix anyway.
The one place the build fails for me is in CEGUIMultiColumnList:
1> CEGUIMultiColumnList.cpp
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory(205): error C2440: 'initializing' : cannot convert from 'int' to 'CEGUI::ListboxItem *'
1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory(288) : see reference to function template instantiation 'void std::allocator<_Ty>::construct<int>(CEGUI::ListboxItem **,_Other &&)' being compiled
1> with
1> [
1> _Ty=CEGUI::ListboxItem *,
1> _Other=int
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(659) : see reference to function template instantiation 'void std::_Cons_val<std::allocator<_Ty>,CEGUI::ListboxItem*,int>(_Alloc &,_Ty1 *,_Ty2 &&)' being compiled
1> with
1> [
1> _Ty=CEGUI::ListboxItem *,
1> _Alloc=std::allocator<CEGUI::ListboxItem *>,
1> _Ty1=CEGUI::ListboxItem *,
1> _Ty2=int
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(679) : see reference to function template instantiation 'void std::vector<_Ty>::emplace_back<int>(_Valty &&)' being compiled
1> with
1> [
1> _Ty=CEGUI::ListboxItem *,
1> _Valty=int
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(666) : see reference to function template instantiation 'std::_Vector_iterator<_Myvec> std::vector<_Ty>::emplace<int>(std::_Vector_const_iterator<_Myvec>,_Valty &&)' being compiled
1> with
1> [
1> _Myvec=std::_Vector_val<CEGUI::ListboxItem *,std::allocator<CEGUI::ListboxItem *>>,
1> _Ty=CEGUI::ListboxItem *,
1> _Valty=int
1> ]
1> c:\users\administrator\documents\visual studio 10\projects\cegui-0.6.2\src\elements\ceguimulticolumnlist.cpp(702) : see reference to function template instantiation 'std::_Vector_iterator<_Myvec> std::vector<_Ty>::insert<int>(std::_Vector_const_iterator<_Myvec>,_Valty &&)' being compiled
1> with
1> [
1> _Myvec=std::_Vector_val<CEGUI::ListboxItem *,std::allocator<CEGUI::ListboxItem *>>,
1> _Ty=CEGUI::ListboxItem *,
1> _Valty=int
1> ]
1> CEGUIMenuItem.cpp
Here's the structure definition that contains the offending vector:
struct ListRow
{
typedef std::vector<ListboxItem*> RowItems;
RowItems d_items;
uint d_sortColumn;
uint d_rowID;
// operators
ListboxItem* const& operator[](uint idx) const {return d_items[idx];}
ListboxItem*& operator[](uint idx) {return d_items[idx];}
bool operator<(const ListRow& rhs) const;
bool operator>(const ListRow& rhs) const;
};
Here's the function that fails in the STL:
template<class _Other>
void construct(pointer _Ptr, _Other&& _Val)
{ // construct object at _Ptr with value _Val
::new ((void _FARQ *)_Ptr) _Ty(_STD forward<_Other>(_Val));
}
#endif /* _HAS_RVALUE_REFERENCES */
This seems to be the only point of failure, but I don't know much about the new rvalue reference stuff so I was wondering if anyone knew of a way to fix this.
Thanks.
The one place the build fails for me is in CEGUIMultiColumnList:
1> CEGUIMultiColumnList.cpp
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory(205): error C2440: 'initializing' : cannot convert from 'int' to 'CEGUI::ListboxItem *'
1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory(288) : see reference to function template instantiation 'void std::allocator<_Ty>::construct<int>(CEGUI::ListboxItem **,_Other &&)' being compiled
1> with
1> [
1> _Ty=CEGUI::ListboxItem *,
1> _Other=int
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(659) : see reference to function template instantiation 'void std::_Cons_val<std::allocator<_Ty>,CEGUI::ListboxItem*,int>(_Alloc &,_Ty1 *,_Ty2 &&)' being compiled
1> with
1> [
1> _Ty=CEGUI::ListboxItem *,
1> _Alloc=std::allocator<CEGUI::ListboxItem *>,
1> _Ty1=CEGUI::ListboxItem *,
1> _Ty2=int
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(679) : see reference to function template instantiation 'void std::vector<_Ty>::emplace_back<int>(_Valty &&)' being compiled
1> with
1> [
1> _Ty=CEGUI::ListboxItem *,
1> _Valty=int
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(666) : see reference to function template instantiation 'std::_Vector_iterator<_Myvec> std::vector<_Ty>::emplace<int>(std::_Vector_const_iterator<_Myvec>,_Valty &&)' being compiled
1> with
1> [
1> _Myvec=std::_Vector_val<CEGUI::ListboxItem *,std::allocator<CEGUI::ListboxItem *>>,
1> _Ty=CEGUI::ListboxItem *,
1> _Valty=int
1> ]
1> c:\users\administrator\documents\visual studio 10\projects\cegui-0.6.2\src\elements\ceguimulticolumnlist.cpp(702) : see reference to function template instantiation 'std::_Vector_iterator<_Myvec> std::vector<_Ty>::insert<int>(std::_Vector_const_iterator<_Myvec>,_Valty &&)' being compiled
1> with
1> [
1> _Myvec=std::_Vector_val<CEGUI::ListboxItem *,std::allocator<CEGUI::ListboxItem *>>,
1> _Ty=CEGUI::ListboxItem *,
1> _Valty=int
1> ]
1> CEGUIMenuItem.cpp
Here's the structure definition that contains the offending vector:
struct ListRow
{
typedef std::vector<ListboxItem*> RowItems;
RowItems d_items;
uint d_sortColumn;
uint d_rowID;
// operators
ListboxItem* const& operator[](uint idx) const {return d_items[idx];}
ListboxItem*& operator[](uint idx) {return d_items[idx];}
bool operator<(const ListRow& rhs) const;
bool operator>(const ListRow& rhs) const;
};
Here's the function that fails in the STL:
template<class _Other>
void construct(pointer _Ptr, _Other&& _Val)
{ // construct object at _Ptr with value _Val
::new ((void _FARQ *)_Ptr) _Ty(_STD forward<_Other>(_Val));
}
#endif /* _HAS_RVALUE_REFERENCES */
This seems to be the only point of failure, but I don't know much about the new rvalue reference stuff so I was wondering if anyone knew of a way to fix this.
Thanks.