Build CEGUI with MinGW+MSYS?

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

Laz-Roc
Just popping in
Just popping in
Posts: 4
Joined: Wed Sep 15, 2010 09:24

Build CEGUI with MinGW+MSYS?

Postby Laz-Roc » Wed Sep 15, 2010 12:08

Hello,

Meanwhile I'm frustrated. Since three days I try to setup anything for the CEGUI & OGRE Tutorial, but fail with CEGUI on Windows in the MinGW environment. So far, I installed MinGW & OGRE (c:/mingw & c:/ogresdk), and both work nicely. Then the trouble began ;) ...

As CEGUI-SDK for MinGW does not contain the CEGUIOgreRenderer.dll I came to the conclusion to build CEGUI myself. The given Building CEGUI Tutorial seem useless, as those steps are for VC. I modified the project/premake/config.lua anyway:

Code: Select all

OGRE_PATHS = { "C:/OgreSDK/OgreSDK_mingw_v1-7-1", "include", "lib/release" }
OIS_PATHS = { "C:/OgreSDK/OgreSDK_mingw_v1-7-1", "include/OIS", "lib/release" }
...
OGRE_RENDERER = true

Appears like I have to install MSYS (MSYS, msysDTK) to c:/msys/1.0 (what I never have done before). Next, I downloaded the CEGUI sources, and installed them into the home folder.

1. Bootstrapping

The bootstrap script did not work properly, so I updated autoconf, automake, libtool, m4. After running again, I was recommended to add AC_CONFIG_MACRO_DIR([m4]) to configure.ac & ACLOCAL_AMFLAGS=-I m4 to Makefile.am, what I have done.

Unfortunately I don't get further, and get following output (note, though you can just run bootstrap, for clarity I break it's commands down here):

Code: Select all

$ libtoolize --force
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: linking file `m4/libtool.m4'.
libtoolize: linking file `m4/ltoptions.m4'.
libtoolize: linking file `m4/ltsugar.m4'.
libtoolize: linking file `m4/ltversion.m4'.
libtoolize: linking file `m4/lt~obsolete.m4'.
$ aclocal $ACLOCAL_FLAGS
/usr/share/aclocal/autoopts.m4:22: warning: underquoted definition of AG_PATH_AUTOOPTS
/usr/share/aclocal/autoopts.m4:22:   run info '(automake)Extending aclocal'
/usr/share/aclocal/autoopts.m4:22:   or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
String found where operator expected at /bin/autom4te line 280, near "error "need GNU m4 1.4 or later: $m4""
        (Do you need to predeclare error?)
syntax error at /bin/autom4te line 280, near "error "need GNU m4 1.4 or later: $m4""
BEGIN not safe after errors--compilation aborted at /bin/autom4te line 453.
aclocal: autom4te failed with exit status: 255
I ommit the other commands (autoheader, automake, autoconf), as bootstrap doesn't display their error messages I have.

2. Configure

Somewhere I read to directly start with configure is okay, so I skipped bootstrapping after I didn't come any further with the above errors. Indeed, after installing pkg-config, glib, freetype-dev, and pcre-bin configure works so far, but ...

Code: Select all

...
checking for Ogre... no
checking for OIS... no
configure: Ogre renderer disabled
...
checking for Lua... no
checking for Lua... no
configure: Building of Lua scripting module is disabled
...

********************************************************************************

* Crazy Eddie's GUI System - Configuration Results Summary
********************************************************************************

* Library Release Version:                              0.7.2
*
* Code options:
*         Building CEGUI in debug mode:                 no
*
* Bi-directional text support:                          no
*
* Building MinizipResourceProvider:                     no
*
* Renderer Modules:
*         Building OpenGL Renderer:                     yes
*             Using external GLEW library:              no
*         Building Ogre Renderer:                       no
*         Building Irrlicht Renderer:                   no
*         Building DirectFB Renderer:                   no
*         Building Null Renderer:                       no
*
* Image Loading Codec Modules:
*         Building Corona Image Codec:                  no
*         Building DevIL Image Codec:                   no
*         Building FreeImage Image Codec:               no
*         Building SILLY Image Codec:                   no
*         Building TGA Image Codec:                     yes
*
*         Default Image Codec will be:                  TGAImageCodec
*
* XML Parser Modules:
*         Building TinyXMLParser:                       yes
*             Using external TinyXML library:           no
*         Building ExpatParser:                         no
*         Building LibXMLParser:                        no
*         Building XercesParser:                        no
*         Building RapidXMLParser:                      no
*
*         Default XML Parser is:                        TinyXMLParser
*
* Scripting:
*         Building Lua scripting module:                no
*         Building tolua++cegui generator:              no
*
* Samples Framework:
*         Building Samples:                             yes
*         GTK2 based dialog for renderer selection:     no
*         OpenGL Renderer available in samples:         no
*         Irrlicht Renderer available in samples:       no
*         DirectFB Renderer available in samples:       no
*         Ogre3D Renderer available in samples:         no
********************************************************************************


Now you can do make && make install.  Good Luck!
... as you see the Ogre Renderer is NOT enabled, but that's what I need.

I'm not sure if Lua is needed (because of config.lua), but I downloaded, build, tested, and installed it anyway:

Code: Select all

$ cd lua*
$ make mingw
$ make test
$ make install

Still no luck. Lua is installed to local by the way :?.

3. Make

Though I am not satisfied with the above cofiguration I gave it a try, and started to make it (requires pcre-lib). Successfully, but as anticipated without the Ogre Renderer.

I stuck here, and appreciate any help - getting this done or binaries - to continue with the CEGUI+OGRE tutorial.

Thanks

IR3uL
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Aug 25, 2010 00:32
Location: Buenos Aires - Argentina

Re: Build CEGUI with MinGW+MSYS?

Postby IR3uL » Wed Sep 15, 2010 13:14

Hi, Laz. It seems pkgconfig isn't finding the metadata for OGRE. Try adding the path to the OGRE's *.pc files to PKG_CONFIG_PATH variable before you run configure.

Edit: I forgot, in order to use the ogre renderer in the samples you need OIS:

Code: Select all

AC_DEFUN([CEGUI_ENABLE_OGRE_RENDERER], [
    AC_ARG_ENABLE([ogre-renderer], AC_HELP_STRING([--disable-ogre-renderer],
                  [Disable building the Ogre renderer module]),
                  [cegui_enable_ogre=$enableval], [cegui_enable_ogre=yes])

    PKG_CHECK_MODULES(Ogre, OGRE >= 1.6.0, [cegui_found_ogre=yes], [cegui_found_ogre=no])
    PKG_CHECK_MODULES(OIS, OIS >= 1.0.0, [cegui_found_ois=yes],[cegui_found_ois=no])

...

dnl see if we should use Ogre in the samples
    if test x$cegui_enable_ogre = xyes; then
        if test x$cegui_found_ois = xno; then
            cegui_samples_use_ogre=no
        else
            cegui_samples_use_ogre=yes
            AC_DEFINE(CEGUI_SAMPLES_USE_OGRE, [],
                      [Define to have the Ogre renderer available in the samples])
            AC_MSG_NOTICE([Use of Ogre3D in Samples is enabled])

...

This is in acinclude.m4 in case you are wondering.

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

Re: Build CEGUI with MinGW+MSYS?

Postby CrazyEddie » Thu Sep 16, 2010 10:24

The fact the SDK is missing the CEGUIOgreRenderer DLLs is a mistake, so I apologise for that. I'll try and make sure that 0.7.3 includes all the files!

Unfortunately I don't have any experience with MinGW + MSYS, so can't advise much on that specifically, unless we just treat it the same as linux.

I can confirm that unless you do certain things, there is no need to run bootstrap on the source release packages, and should just run the provided configure script.

Lua is not needed unless you want to use the Lua script module. Those lua files in projects/premake are unrelated to that, and are not used anyway for configure / make command line builds.

With the above clarifications and IE3uL's advice, hopefully you can move forwards :)

CE.

IR3uL
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Aug 25, 2010 00:32
Location: Buenos Aires - Argentina

Re: Build CEGUI with MinGW+MSYS?

Postby IR3uL » Thu Sep 16, 2010 13:54

CrazyEddie wrote:With the above clarifications and IE3uL's advice, hopefully you can move forwards :)


IR3uL with R ^^

Laz-Roc
Just popping in
Just popping in
Posts: 4
Joined: Wed Sep 15, 2010 09:24

Re: Build CEGUI with MinGW+MSYS?

Postby Laz-Roc » Fri Sep 17, 2010 01:56

Thank you very mucho! That helped me a lot.

1. pkg-config

As I couldn't find any OGRE*.pc & OIS.pc files, I copied them from Linux into the lib/pkgconfig directory of MSYS, and adjusted them a little to my installation. I know it's ugly, but I had to change the Cflags as below (instead of Cflags: -I${includedir} -I${includedir}/OGRE -pthread) to successfully configure with Ogre Renderer enabled.

Code: Select all

prefix=c:/OgreSDK/OgreSDK_mingw_v1-7-1
exec_prefix=${prefix}
libdir=${prefix}/lib/release
includedir=${prefix}/include
plugindir=${libdir}/OGRE

Name: OGRE
Description: Object-Oriented Graphics Rendering Engine
Version: 1.7.1
URL: http://www.ogre3d.org
Libs: -L${libdir} -lOgreMain  -lpthread
Cflags: -Ic:/OgreSDK/OgreSDK_mingw_v1-7-1/include -Ic:/OgreSDK/OgreSDK_mingw_v1-7-1/include/OGRE -pthread

Code: Select all

prefix=c:/OgreSDK/OgreSDK_mingw_v1-7-1
exec_prefix=${prefix}
libdir=${exec_prefix}/lib/release
includedir=${prefix}/include

Name: OIS
Description: Crossplatform C++ Input Framework
Version: 1.2.0
Libs: -L${libdir} -lOIS

Cflags: -Ic:/OgreSDK/OgreSDK_mingw_v1-7-1/include -Ic:/OgreSDK/OgreSDK_mingw_v1-7-1/include/OIS -pthread


2. Make

The compilation needs Boost, which can be found in the OgreSDK, and just copied it to MinGW (boost to include/boost, lib to lib).

Also pthreads is required, and I renamed it to libptread.dll.a in MinGW's lib folder.

Now, make and drink a beer :pint:

3. CEGUI & OGRE Tutorial

With the new files I am able to build the tutorial, pass the 'OGRE Engine Rendering Setup', and then it fails.

Here are the error messages of Ogre.log:

Code: Select all

03:12:26: Compiler error: object unsupported by render system in ASMSwizzle.material(1)
03:12:26: Compiler error: object unsupported by render system in Examples-Advanced.material(383)
03:12:26: Compiler error: object unsupported by render system in OffsetMapping.material(18)
03:12:26: Compiler error: unknown error in RTShaderSystem.material(23): token "rtshader_system" is not recognized

CEGUI.log has no error messages, but on the command line:

Code: Select all

...
Parsing script RTShaderSystem.material
03:12:26: Compiler error: unknown error in RTShaderSystem.material(23): token "rtshader_system" is not recognized
...
Assertion failed: ms_Singleton, file C:\OgreSDK\CEGUI-SDK-0.7.2-mingw\include/CEGUI/CEGUISingleton.h line 79

This application has requested the Runtime to terminate it in an unsusual way.
Please contact the application's support team for more information.

Argh ... so close - but I am tired and sloppy now.

IR3uL
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Aug 25, 2010 00:32
Location: Buenos Aires - Argentina

Re: Build CEGUI with MinGW+MSYS?

Postby IR3uL » Fri Sep 17, 2010 02:13

Laz-Roc wrote:CEGUI.log has no error messages, but on the command line:

Code: Select all

...
Parsing script RTShaderSystem.material
03:12:26: Compiler error: unknown error in RTShaderSystem.material(23): token "rtshader_system" is not recognized
...
Assertion failed: ms_Singleton, file C:\OgreSDK\CEGUI-SDK-0.7.2-mingw\include/CEGUI/CEGUISingleton.h line 79

This application has requested the Runtime to terminate it in an unsusual way.
Please contact the application's support team for more information.

Argh ... so close - but I am tired and sloppy now.


I think you did not properly initialize CEGUI. Have a look at http://www.cegui.org.uk/docs/current/rendering_tutorial.html

User avatar
emarcotte
Quite a regular
Quite a regular
Posts: 55
Joined: Fri Dec 26, 2008 14:30
Contact:

Re: Build CEGUI with MinGW+MSYS?

Postby emarcotte » Fri Sep 17, 2010 14:25

OGRE doesn't generate the pkg-config files on msys (I've attempted a couple of times to fix this but never got it working 100%). I usually send up telling CEGUI about ogre using Ogre_CFLAGS, etc.

IR3uL
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Aug 25, 2010 00:32
Location: Buenos Aires - Argentina

Re: Build CEGUI with MinGW+MSYS?

Postby IR3uL » Fri Sep 17, 2010 17:59

emarcotte wrote:OGRE doesn't generate the pkg-config files on msys

I wasn't aware of that, i made the assumption they were available, he found a workaround tho =D

Laz-Roc
Just popping in
Just popping in
Posts: 4
Joined: Wed Sep 15, 2010 09:24

Re: Build CEGUI with MinGW+MSYS?

Postby Laz-Roc » Fri Sep 17, 2010 21:42

I think you did not properly initialize CEGUI. Have a look at http://www.cegui.org.uk/docs/current/re ... orial.html

Indeed, had to add CEGUI::System::create(*mRenderer); after bootstrapSystem.

Still not through (CEGUI.log):

Code: Select all

CEGUI::InvalidRequestException in file C:\CEGUI-0.7.2-mingw\cegui\src\CEGUIDefaultResourceProvider.cpp(103) : DefaultResourceProvider::load: TaharezLook.scheme does not exist

This confuses me again. Ogre did create the resource groups (Fonts, Imagesets, Layouts, LookNFeel, Schemes) and adds their location. The pathes in resource.cfg should be correct (tested absolute & relative).

When I hardcode the path in my source code TaharezLook.scheme is found, but have to edit pathes inside there. Of course this isn't desired by me.

Anyway, it's late enough here. Have a nice weekend.

IR3uL
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Aug 25, 2010 00:32
Location: Buenos Aires - Argentina

Re: Build CEGUI with MinGW+MSYS?

Postby IR3uL » Fri Sep 17, 2010 23:49

You don't have to call System::create() yourself, the bootstrap function do it for you. I don't know how OgreResourceProvider works, my only advice is to check the spelling (i had issues a lot of times before with this) of the paths and resource groups names. Also, idk if is necessary with OgreResourceProvider, but with the Default RP you have to set the default resource groups

Code: Select all

// set the default resource groups to be used
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");

// setup default group for validation schemas
CEGUI::XMLParser* parser = CEGUI::System::getSingleton().getXMLParser();
if (parser->isPropertyPresent("SchemaDefaultResourceGroup"))
    parser->setProperty("SchemaDefaultResourceGroup", "schemas");


Take a look at http://www.cegui.org.uk/docs/current/resprov_tutorial.html for more details. Also, i recommend you closely read (more than once if it's needed) all the beginners tutorials at http://www.cegui.org.uk/docs/current/index.html

If you can't find the way, post the initialization code and i will take a look.

Have a nice weekend too =D

Laz-Roc
Just popping in
Just popping in
Posts: 4
Joined: Wed Sep 15, 2010 09:24

Re: Build CEGUI with MinGW+MSYS?

Postby Laz-Roc » Mon Sep 20, 2010 19:54

So, one bad and one good news. The bad one first: the CEGUI-OGRE tutorial still doesn't work here. The good one: CEGUIs demos do (don't know why I haven't tested them earlier).

Just want let you know that it's no CEGUI-OGRE issue. IMO the thread is solved.

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

Re: Build CEGUI with MinGW+MSYS?

Postby CrazyEddie » Tue Sep 21, 2010 09:38

IR3uL wrote:
CrazyEddie wrote:With the above clarifications and IE3uL's advice, hopefully you can move forwards :)


IR3uL with R ^^

:oops:

Yeah, I knew that. My excuse is that those two keys are right next to each other :P

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 5 guests