Build error: "cast from 'WCHAR*' to 'WORD' loses precision"

MInner

25-07-2011 23:01:52

I'm trying to build MyGUI 3.2_RC1 for using in OGRE 1.7.2 (MinGW)

DEPENDENCE_DIR = freetype binaries directory
OGRE_BUILD, OGRE_SOURCE = OGRE SDK directory

It configures well and MyGUI.Engine builds well too. But in the very first file

D:\Dev\MyGUI_3.2.0_RC1\Common\Input\Win32\ResourceW32Pointer.cpp: In member func
tion 'virtual void input::ResourceW32Pointer::deserialization(MyGUI::xml::Elemen
t*, MyGUI::Version)':
D:\Dev\MyGUI_3.2.0_RC1\Common\Input\Win32\ResourceW32Pointer.cpp:39: error: cast
from 'CHAR*' to 'WORD' loses precision


I solved this by using unicode: (advice from stackoverflow)
#ifndef UNICODE
#define UNICODE
#endif

#ifndef _UNICODE
#define _UNICODE
#endif


Now this error disappeared and "WCHAR*' to 'WORD loses precision" appeared in line:

mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));
, mHandle - size_t - WORD
, LoadCursor returns HCURSOR.

I'd really want to use this library.

And yes, this topic is equivalent to the one in Russian OGRE community.

Thanks beforehand.

MInner

27-07-2011 00:10:51

The solution is removing MAKEINTRESOURCE in file ResourceW32Manager.cpp .