[Warning] ImagesetManager::create("f.imageset") IDE error

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

Just popping in
Just popping in
Posts: 2
Joined: Fri Apr 27, 2012 09:46

[Warning] ImagesetManager::create("f.imageset") IDE error

Postby pasmoi » Fri Apr 27, 2012 10:29

I've first posted something about that on ogre forum, and they helped me find that "bug".

(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


it was rennamed from the old "createImages" method, but that has nothing to do with the problem:

Code: Select all


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.

User avatar
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic

Re: [Warning] ImagesetManager::create("f.imageset") IDE erro

Postby Kulik » Fri Apr 27, 2012 10:46

It was actually me who helped you on Ogre3d forum ;-)

I would prefer writing proper code and ignoring IDE bugs to this atrocity. We won't write subpar code just to make all IDEs happy. It's also futile since you would keep hitting bugs in various obscure IDEs until you just coded in plain functions taking integers...

USE VIM! :lol: omnicppcomplete seems to work fine with this.

Just popping in
Just popping in
Posts: 2
Joined: Fri Apr 27, 2012 09:46

Re: [Warning] ImagesetManager::create("f.imageset") IDE erro

Postby pasmoi » Fri Apr 27, 2012 11:10

Thanks for your help. (You saved me).
(Before today, i though Eclipse was a good, stable, widespread IDE ...)

All the ".layout" and ".imageset" files of my project are written with vi.
So are my ogre .material files.

before switching to eclipse, i was rather using emacs ...
(but my friends where laughing at me, telling me that emacs was not my editor, but that is was my Operating System).

vim, I only use it to write the lisp code of my emacs configuration file ...
(and when i program while eating pizza, because, with vim, you can do everything with one single finger). [troll on](While in Emacs ... Escape-Meta-Alt-Control-Shift ... need 5 clean hands).[/troll]

maybe i'll try to build a good vim conf to use it as my IDE for Cegui develloping ...

thanks again

Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 1 guest