(Or maybe not a real bug, but just an anomaly).
It's not necessary to fix it, but since i spent several days pulling my hairs off because of that, i though i'd at least leave the solution about it here.
(in order to "document" it)
So, in the ImagesetManager class, there is a usefull function create("f.imageset"):
Code: Select all
ImagesetManager::create("f.imageset")
it was rennamed from the old "createImages" method, but that has nothing to do with the problem:
Code: Select all
ImagesetManager::createImages("f.imageset")
a standart way of using it is:
Code: Select all
CEGUI::ImagesetManager::getSingleton().create( "f.imageset" );
That works fine, compiles fines, and code created that uses that function works fine.
But ... if you are develloping with Cegui from the c++ IDE eclipse-CDT, when trying to use that function, eclipse will "display" a compilling error. (But that a lie, there is no compilling error, or at least, gcc did not issue any compilling error: eclipse is lying).
(the real compilation made by gcc went fine, without any error)
Eclipse will display:
Code: Select all
Errors (1 item)
Description Resource Path Location Type
Invalid arguments '
Candidates are:
CEGUI::Imageset & create(const CEGUI::String &, CEGUI::Texture &, enum CEGUI::XMLResourceExistsAction)
' MyTestCeguiModule.cpp /my3damazingproject line 707 Semantic Error
It's because instead of refering to the ImagesetManager::create
Eclipse refers to Imageset::create
As we can see by doing ctrl+click on the "create" word in the code ... or reading "properly" the error (that states CEGUI::Imageset and not CEGUI::ImagesetManager).
There's obviously something screwing up in the templates and the getSingleton() method ...
Or maybe just that eclipse (both my usual eclipse-Galileo and the last eclipse-indigo) does not manages namespaces properly ...
(I wonder if any other IDE makes the same "big fail").
By the way, to any programmer that "spots" this "compilling error", (for me) it was "safe" to ignore the error: the program was actually properly compilled, and works fine.
Anyway, this error was anoying to my eyes, so i ended up telling my Eclipse IDE to shut up that way:
Code: Select all
CEGUI::ImagesetManager *im = &(CEGUI::ImagesetManager::getSingleton());
CEGUI::NamedXMLResourceManager<CEGUI::Imageset, CEGUI::Imageset_xmlHandler> *castedIm = NULL;
castedIm = (CEGUI::NamedXMLResourceManager<CEGUI::Imageset, CEGUI::Imageset_xmlHandler>*) im;
castedIm->create( "f.imageset" );
or in one dirty long line:
Code: Select all
( (CEGUI::NamedXMLResourceManager<CEGUI::Imageset, CEGUI::Imageset_xmlHandler>&) CEGUI::ImagesetManager::getSingleton()).create( "f.imageset" );
(yes, a good old and dirty explicit C cast)
Ho, by the way: Cegui is great, thanks all for making it.