Page 1 of 1

invalid conversion error while compiling cegui-0.7.1

Posted: Tue Mar 23, 2010 13:29
by r.stiltskin
While attempting to build cegui-0.7.1 in Ubuntu 8.04, make failed with the following error:

Code: Select all

Making all in DevILImageCodec
make[4]: Entering directory `/usr/local/ogre/CEGUI-0.7.1/cegui/src/ImageCodecModules/DevILImageCodec'
/bin/bash ../../../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../../cegui/include -I../../../../cegui/include -I../../../../cegui/include/ImageCodecModules/DevILImageCodec -DUSE_DEVIL_LIBRARY    -g -O2 -MT libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.lo -MD -MP -MF .deps/libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.Tpo -c -o libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.lo `test -f 'CEGUIDevILImageCodec.cpp' || echo './'`CEGUIDevILImageCodec.cpp
mkdir .libs
 g++ -DHAVE_CONFIG_H -I. -I../../../../cegui/include -I../../../../cegui/include -I../../../../cegui/include/ImageCodecModules/DevILImageCodec -DUSE_DEVIL_LIBRARY -g -O2 -MT libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.lo -MD -MP -MF .deps/libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.Tpo -c CEGUIDevILImageCodec.cpp  -fPIC -DPIC -o .libs/libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.o
CEGUIDevILImageCodec.cpp: In member function ‘virtual CEGUI::Texture* CEGUI::DevILImageCodec::load(const CEGUI::RawDataContainer&, CEGUI::Texture*)’:
CEGUIDevILImageCodec.cpp:64: error: invalid conversion from ‘const void*’ to ‘ILvoid*’
CEGUIDevILImageCodec.cpp:64: error:   initializing argument 2 of ‘ILboolean ilLoadL(ILenum, ILvoid*, ILuint)’
make[4]: *** [libCEGUIDevILImageCodec_la-CEGUIDevILImageCodec.lo] Error 1
make[4]: Leaving directory `/usr/local/ogre/CEGUI-0.7.1/cegui/src/ImageCodecModules/DevILImageCodec'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/local/ogre/CEGUI-0.7.1/cegui/src/ImageCodecModules'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/ogre/CEGUI-0.7.1/cegui/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/ogre/CEGUI-0.7.1/cegui'
make: *** [all-recursive] Error 1



Would any additional information be helpful?
Please advise. Thanks.

Edit: added a few lines preceding the error to the above output to provide context. I am using gcc 4.2.4.
Also, I just tried CEGUI-0.6.2 and it compiled completely -- no problems noted.

Re: invalid conversion error while compiling cegui-0.7.1

Posted: Tue Mar 23, 2010 15:53
by CrazyEddie
Hi,

This is a incompatibility between the CEGUI code and the version of DevIL you are building against (1.6.?)? When the 1.7.something version of DevIL was released they broke the interface and we duly incorporated a fix, however it messes up support for the old (basically obsolete) versions of DevIL. You have a choice to make, as far as a fix goes:

1) Update the DevIL version to 1.7.8 or some similar newer release.
- or -
2) Disable the build of the DevIL codec, and use some other lib: pass --disable-devil to configure to do this.
- or -
3) Go into the file CEGUIDevilImageCodec.cpp and at line 64 and change the static_cast<const void*> to a c-style cast to cast types and cast away const, like: (ILvoid*)

HTH

CE

Re: invalid conversion error while compiling cegui-0.7.1

Posted: Wed Mar 24, 2010 03:55
by r.stiltskin
Changing the cast seemed the easiest way to go, and it has now compiled successfully. I'm sure this will be fine for my purposes. Thanks.