Page 1 of 1

[BUG & FIX] Compiling 0.7.5 with GCC 4.6.0 ptrdiff_t

Posted: Wed Apr 20, 2011 22:44
by KishukuOni
I just upgraded to GCC 4.6.0 and ran into this issue when compiling CEGUI 0.7.5.
This may be in other versions, but I don't know.
The compiler error was:

Code: Select all

../../cegui/include/CEGUIString.h:68:11: error: 'ptrdiff_t' does not name a type


It seems GNU moved some header includes around at some point.
Anyway, all I did to fix it was to add #include <cstddef> to the list of included headers in CEGUIString.h

This is pretty simple but just wanted to post this in case anyone else ran into the same problem.

Re: [BUG & FIX] Compiling 0.7.5 with GCC 4.6.0 ptrdiff_t

Posted: Thu Apr 21, 2011 08:23
by CrazyEddie
Thanks for the heads up. I will make sure it's addressed :)

CE.

Re: [BUG & FIX] Compiling 0.7.5 with GCC 4.6.0 ptrdiff_t

Posted: Tue Aug 23, 2011 23:39
by EventHorizon
I just encountered this same error - ubuntu 11.10 using cegui 0.7.5

cd ~/src/CEGUI-0.7.5/
./configure --with-gtk2 --with-boost-python
make
...
In file included from ../../cegui/include/CEGUIAffector.h:33:0,
from CEGUIAffector.cpp:30:
../../cegui/include/CEGUIString.h:65:11: error: 'ptrdiff_t' does not name a type

I can confirm your fix worked for me as well. Thanks KishukuOni

cheers Scott