[SOLVED]DefaultResourceProvider mac compile error

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

nairboon
Just popping in
Just popping in
Posts: 7
Joined: Fri Feb 06, 2009 20:36

[SOLVED]DefaultResourceProvider mac compile error

Postby nairboon » Fri Feb 06, 2009 20:50

I can't use the DefaultResourceProvider: (as in the tutorial@wiki)

Code: Select all

 CEGUI::DefaultResourceProvider* rp =
            static_cast(CEGUI::System::getSingleton().getResourceProvider());

i get that error:

Code: Select all

error: expected `<' before ‘(’ token
error: expected type-specifier before ‘(’ token
error: expected `>' before ‘(’ token

i tried also casting like that:

Code: Select all

static_cast<CEGUI::DefaultResourceProvider*>(..)

I'm not using Ogre.
cegui, 0.6.2
gcc 4.2
mac 10.5

Any ideas?
Last edited by nairboon on Sat Feb 07, 2009 20:46, edited 1 time in total.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sat Feb 07, 2009 09:21

Hi, and welcome :)

Firstly, I had a look and there is an error in the tutorial as regards to the way that cast is presented. Apologies for that mistake; I wonder how many other people have been caught by that - at least one, since they posted a while ago, but it didn't occur to me that the tutorial had the incorrect cast usage - what a tool I am :lol:

Anyway, thanks for that. And the correct usage should indeed be:

Code: Select all

CEGUI::DefaultResourceProvider* rp =
            static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());


However, you indicate that you've tried this, can you let us know the error you get in this case? Without the other error I can only guess at the cause, so at this stage I'll recommend you ensure you have included the required headers, which in this case is "CEGUIDefaultResourceProvider.h".

HTH

CE.

P.S. I'll fix the tutorial immediately after this session answering forum posts :)

[edit]
P.P.S. This is not a simple text fix - the article source is correct. It's actually an issue related to something else, I'll look into fixing it over this weekend, though it's a little more involved now; it also means that all other code on the Wiki will be affected by this, arrrgh! :evil:

nairboon
Just popping in
Just popping in
Posts: 7
Joined: Fri Feb 06, 2009 20:36

Postby nairboon » Sat Feb 07, 2009 20:46

What a foolish mistake, I included CEGUIResourceProvider.h, but not CEGUIDefaultResourceProvider.h. Maybe you should add a smal notice about that to the wiki, otherwise there'll be more cegui-newbies with the same problem. But thanks for the help.
I've a lite feautre request, may you can add smt like that to CEGUIDefaultResourceProvider.cpp to avoid simple path mistakes, when forgetting the "/" at the end:

Code: Select all

if(final_filename[final_filename.length()-1] != '/')
final_filename += string("/");

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sun Feb 08, 2009 08:42

nairboon wrote:What a foolish mistake, I included CEGUIResourceProvider.h, but not CEGUIDefaultResourceProvider.h. Maybe you should add a smal notice about that to the wiki, otherwise there'll be more cegui-newbies with the same problem. But thanks for the help.
I've a lite feautre request, may you can add smt like that to CEGUIDefaultResourceProvider.cpp to avoid simple path mistakes, when forgetting the "/" at the end:

Code: Select all

if(final_filename[final_filename.length()-1] != '/')
final_filename += string("/");


Yeah, I'll definitely get this done.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sun Feb 08, 2009 20:07

Just a quick update...

I have fixed the issue that caused certain code constructs to be incorrectly stripped from the output on the wiki.

I have added a note in the resource setup tutorial about including the correct header ;)

I'll add the check for the trailing path separator in v0-6 branch sometime over this coming week.

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 27 guests