[SOLVED] Compilation error with Python bindings and OGRE

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

TotallyRandomName
Just popping in
Just popping in
Posts: 14
Joined: Fri Jan 17, 2014 19:59

[SOLVED] Compilation error with Python bindings and OGRE

Postby TotallyRandomName » Fri Feb 21, 2014 17:12

When compiling CEGUI with the default CMake settings, the process fails with many errors due to "wrong usage of incomplete class TexturePtr" and others similar. Disabling the option CEGUI_BUILD_PYTHON_MODULES makes it disappear.

In order to solve it, I had to edit the file "cegui/src/ScriptModules/Python/bindings/generators/include/python_CEGUIOgreRenderer.h" in the source folder, which looked like this:

Code: Select all

#include "CEGUI/String.h"
#include "CEGUI/GeometryBuffer.h"
#include "CEGUI/Texture.h"
#include "CEGUI/TextureTarget.h"
#include "CEGUI/GUIContext.h"

#include "CEGUI/RendererModules/Ogre/Renderer.h"
#include "CEGUI/RendererModules/Ogre/ResourceProvider.h"
#include "CEGUI/RendererModules/Ogre/ImageCodec.h"

namespace Ogre
{
    class RenderTarget {};
    class TexturePtr {};
    class Matrix4 {};
}


and replace it for the following, which I took from "cegui/include/CEGUI/RendererModules/Ogre/Renderer.h" (I added curly brackets where necessary):

Code: Select all

#include "CEGUI/String.h"
#include "CEGUI/GeometryBuffer.h"
#include "CEGUI/Texture.h"
#include "CEGUI/TextureTarget.h"
#include "CEGUI/GUIContext.h"

#include "CEGUI/RendererModules/Ogre/Renderer.h"
#include "CEGUI/RendererModules/Ogre/ResourceProvider.h"
#include "CEGUI/RendererModules/Ogre/ImageCodec.h"

namespace Ogre
{
    class Root{};
    class RenderSystem{};
    class RenderTarget{};
    #if (CEGUI_OGRE_VERSION < ((1 << 16) | (9 << 8) | 0))
        class TexturePtr{};
    #else
        template<typename T> class SharedPtr{};
        class Texture{};
        typedef SharedPtr<Texture> TexturePtr;
    #endif
    class Matrix4{};
}


After this, it compiled OK.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Compilation error with Python bindings and OGRE

Postby Ident » Sat Feb 22, 2014 05:15

Can u create a pull request for this targeting v0-8 ?
CrazyEddie: "I don't like GUIs"

TotallyRandomName
Just popping in
Just popping in
Posts: 14
Joined: Fri Jan 17, 2014 19:59

Re: Compilation error with Python bindings and OGRE

Postby TotallyRandomName » Sat Feb 22, 2014 12:49

Done, it took me a while as this was my first time... I hope nothing explodes.

https://bitbucket.org/cegui/cegui/pull-request/48/solved-compiled-error-with-python-bindings/diff

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Compilation error with Python bindings and OGRE

Postby Ident » Sat Feb 22, 2014 16:24

Great, thanks! See my reply please.
CrazyEddie: "I don't like GUIs"

TotallyRandomName
Just popping in
Just popping in
Posts: 14
Joined: Fri Jan 17, 2014 19:59

Re: Compilation error with Python bindings and OGRE

Postby TotallyRandomName » Sat Feb 22, 2014 21:45

Done. Now you see mine!

Basically, if I set the pull request target to CEGUI v0.8, it tells me that 400+ files will be modified. If I leave it to default, just 1 file is modified (the one I edited). And I don't understand that, because I made sure to choose v0.8 as the branch to fork from... Did I miss something?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Compilation error with Python bindings and OGRE

Postby Ident » Sat Feb 22, 2014 22:36

Did you update to the right branch locally before you made changes?
CrazyEddie: "I don't like GUIs"

TotallyRandomName
Just popping in
Just popping in
Posts: 14
Joined: Fri Jan 17, 2014 19:59

Re: Compilation error with Python bindings and OGRE

Postby TotallyRandomName » Sun Feb 23, 2014 11:13

Whoops!

Fixed. Created another fork and pull request, this time for v0-8. It works now. Removed the other one. Thanks!

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Compilation error with Python bindings and OGRE

Postby Ident » Wed Feb 26, 2014 14:14

Thanks a lot, it is merged!
CrazyEddie: "I don't like GUIs"

TotallyRandomName
Just popping in
Just popping in
Posts: 14
Joined: Fri Jan 17, 2014 19:59

Re: [SOLVED] Compilation error with Python bindings and OGRE

Postby TotallyRandomName » Wed Feb 26, 2014 16:08

It was nothing, the fix was in your own code, in the OGRE renderer... :D


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 10 guests