Page 1 of 1

cegui_mk2-0.2.1 and Fedora Core 4 compilation

Posted: Sat Jul 16, 2005 00:01
by apperenticegp
Hello everybody. I'm having problems compiling the said release on my newly installed Fedora Core 4 on my Athlon64 PC. Here are the error messages:

../include/CEGUISingleton.h: In constructor 'CEGUI::Singleton<T>::Singleton() [with T = CEGUI::Logger]':
../include/CEGUILogger.h:146: instantiated from here
../include/CEGUISingleton.h:61: error: cast from 'CEGUI::Singleton<CEGUI::Logger>*' to 'int' loses precision
../include/CEGUISingleton.h:61: error: cast from 'CEGUI::Logger*' to 'int' loses precision
../include/CEGUISingleton.h:62: error: cast from 'CEGUI::Singleton<CEGUI::Logger>*' to 'int' loses precision
make[2]: *** [CEGUIExceptions.lo] Error 1
make[2]: Leaving directory `/usr/local/src/cegui_mk2-0.2.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/cegui_mk2-0.2.1/src'
make: *** [all-recursive] Error 1

How can I fix this one?

Re: cegui_mk2-0.2.1 and Fedora Core 4 compilation

Posted: Sat Jul 16, 2005 08:18
by CrazyEddie
You might consider the latest 0.3.0 release (although without a 'cvs update' done on it, that has it's own issue under FC4).

Anyhow, to fix this issue, try the following patch:

Code: Select all

Index: include/CEGUISingleton.h
===================================================================
RCS file: /cvsroot/crayzedsgui/cegui_mk2/include/CEGUISingleton.h,v
retrieving revision 1.3
diff -u -r1.3 CEGUISingleton.h
--- include/CEGUISingleton.h   15 Jan 2005 19:18:19 -0000   1.3
+++ include/CEGUISingleton.h   16 Jul 2005 08:14:38 -0000
@@ -58,8 +58,7 @@
     Singleton( void )
     {
         assert( !ms_Singleton );
-        int offset = (int)(T*)1 - (int)(Singleton <T>*)(T*)1;
-        ms_Singleton = (T*)((int)this + offset);
+        ms_Singleton = static_cast<T*>(this);
     }
    ~Singleton( void )
         {  assert( ms_Singleton );  ms_Singleton = 0;  }

Re: cegui_mk2-0.2.1 and Fedora Core 4 compilation

Posted: Sat Jul 16, 2005 11:08
by apperenticegp
Thank you very much CrazyEddie. It worked! I'll also check the CVS version of version 3. You were right about having issues on the latest download on Fedora Core 4.