I'm trying to build CEGUI following part2 of this guide http://ogre17crashcourse.blogspot.com/2 ... -work.html but I have this error
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xmemory(208): 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
CEGUI 0.7 error C2440:'initializing'
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: CEGUI 0.7 error C2440:'initializing'
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: CEGUI 0.7 error C2440:'initializing'
I have same error, could this be explained a tad more? Ive downloaded and applied those files.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: CEGUI 0.7 error C2440:'initializing'
You mean explain the error? It basically means that the 0 was interpreted as the interger zero which can't be implicitly cast by the compiler to a pointer type (ListboxItem*), so the compiler requires the cast to be explicit. Why does this show up only on this compiler and only now? To be honest, I didn't get into a deep analysis of the situation 
CE.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: CEGUI 0.7 error C2440:'initializing'
This is the block line erroring
This is the line specifically,
This is the error specifically,
Code: Select all
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));
}
This is the line specifically,
Code: Select all
::new ((void _FARQ *)_Ptr) _Ty(_STD forward<_Other>(_Val));This is the error specifically,
Code: Select all
Error 1 error C2440: 'initializing' : cannot convert from 'int' to 'CEGUI::ListboxItem *' e:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory 208
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: CEGUI 0.7 error C2440:'initializing'
I'm not sure if you're asking this for academic purposes or if you are still getting this issue 
The issue is fixed, and the fix is to explicitly cast the 0 to the CEGUI::ListboxItem* type. I know it's fixed and that this fix works because I was compiling it just fine on VC++ 2010 over the weekend
CE.
The issue is fixed, and the fix is to explicitly cast the 0 to the CEGUI::ListboxItem* type. I know it's fixed and that this fix works because I was compiling it just fine on VC++ 2010 over the weekend
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: CEGUI 0.7 error C2440:'initializing'
More, educational purposes. I have hundreds of notes on everything. 
Once again, thanks CE. I have overwhelmed myself with too big of tasks, so I am going to start in 2D side scroller.
Everything seems so clear in my head / notes, but my damn PC is too cluttered. Might go for a expensive monitor with ridiculous resolution, my 1360 x 768 cheap flat screens ain't cuttin it.
Once again, thanks CE. I have overwhelmed myself with too big of tasks, so I am going to start in 2D side scroller.
Everything seems so clear in my head / notes, but my damn PC is too cluttered. Might go for a expensive monitor with ridiculous resolution, my 1360 x 768 cheap flat screens ain't cuttin it.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: CEGUI 0.7 error C2440:'initializing'
czzplnm wrote:More, educational purposes. I have hundreds of notes on everything.
Cool. I think basically it has to do with the compiler not implicitly casting 0 to a null pointer of whatever type - meaning it just sees it as integer zero. It may be related to the introduction of nullptr in C++0x, which MSVC++ 2010 supports. I don't know for sure, though.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Who is online
Users browsing this forum: No registered users and 28 guests
