[2.1] How to compile MyGUI for Ogre 2.1

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

[2.1] How to compile MyGUI for Ogre 2.1

Post by 123iamking »

First, I read the topic about MyGUI is successfully ported to Ogre 2.1
Then I clone the MyGUI for Ogre 2.1 from GitHub GitHub
Then I read this article to learn to compile MyGUI
After reading, I clone the MyGUI source and setup with CMake:
  • MYGUI_DEPENDENCIES_DIR = Dependencies. (ref here)
  • OGRE_SOURCE_DIR = Ogre 2.1 source (I have to set it manually, seem the environment variable not work)
  • OGRE_BUILD = Ogre 2.1 build folder which is generated from CMake
  • MYGUI_RENDERSYSTEM = 8 (ref here)

But after set MYGUI_RENDERSYSTEM = 8, I got the error:

Code: Select all

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
SDL2_IMAGE_INCLUDE_DIR (ADVANCED)
...
SDL2_IMAGE_LIBRARY (ADVANCED)
I thought I have provide SDL2 when I give CMake MYGUI_DEPENDENCIES_DIR, so I'm stuck here. Please help me :cry:[/s] --> This error happen because I mistakenly use branch 'Master' instead of branch 'ogre2.1' for MyGUI- silly me :p

Note: currently (18/10/2017), I see that GitHub is marking MyGUI: build error, I don't know the reason I can't compile MyGUI has anything to do with this.
Last edited by 123iamking on Wed Oct 18, 2017 4:07 pm, edited 3 times in total.
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by al2950 »

Not sure why its looking for SDL, you sure you dont have a dirty cmake cache!? I would try and just remove the SDL entry and see if it stops complaining about it. (If its an cmake cache issue, it wont come back)

Also I noticed your github link is referring to Ogre2.0 branch not the Ogre2.1 branch.

Thirdly I just point MyGui to my OgreDependenciesDir, I have never tried the guide you pointed to so dont know if it will work. Either way you are going to want to use the same lib versions when compiling Ogre and MyGUi anyway.
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by 123iamking »

al2950 wrote:Not sure why its looking for SDL, you sure you dont have a dirty cmake cache!? I would try and just remove the SDL entry and see if it stops complaining about it. (If its an cmake cache issue, it wont come back)

Also I noticed your github link is referring to Ogre2.0 branch not the Ogre2.1 branch.

Thirdly I just point MyGui to my OgreDependenciesDir, I have never tried the guide you pointed to so dont know if it will work. Either way you are going to want to use the same lib versions when compiling Ogre and MyGUi anyway.
Ops :oops: You're right, I mistake MyGui-Ogre2.0 with MyGui-Ogre2.1 (But since both has the same git address, so even I was on MyGui-Ogre2.1, I was still wrong :) )
But thanks to this, I realize that I was on branch master all along :p I have to switch to branch 2.1.
Image

So after I switch to branch 2.1, CMake errors about SDL are gone :D


But I still can't build MyGUI.
Firstly, the Ogre fields of CMake bloom a lot after I manually enter some of the first Ogre fields (MyGui's CMake)
Image
Maybe I did something wrong :cry:

Secondly, I see that MyGUI has weird include, like in the file E:\Source\mygui\Platforms\Ogre2\Ogre2Platform\include\MyGUI_Ogre2Texture.h

Code: Select all

#include <Hlms/Unlit/OgreHlmsUnlitDatablock.h>//File not found
The file OgreHlmsUnlitDatablock.h is located at "E:\Source\OgreSDK\Components\Hlms\Unlit\include\OgreHlmsUnlitDatablock.h"
So the include must be wrong --> MyGUI's solution build fail :( (there are more error, but I take one for example)
So I think the MyGUI is incomplete for Ogre 2.1 and I should wait for it :)

Thank al2950 a lot for helping me :)
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by al2950 »

I am currently using MyGUI in productions systems, and although its not 100% functional it meets all my needs :) ( I believe there is a small compile issues with the very latest version of Ogre 2.1 caused by changes to render queue sorting API, but is a very easy fix)

Looking at your cmake, it clearly has not found Ogre properly. I always found the FindOGRE.cmake a bit over complicated, but I do one of 2 things.
1) - setup an OGRE_HOME environment variable and set it to the build SDK director ("E:\source\_build\SDK")
2) - pass cmake an extra (using -D cmd line option) "OGRE_SDK" and set it to the build SDK dir as above.

The reason for your compile issue is that it has not set the CMAKE include dirs for the Unlit HLMS, but oddly it has found the libs and dlls. Have you built the 'INSTALL' project properly in Ogre for both release and debug?
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by 123iamking »

al2950 wrote: Looking at your cmake, it clearly has not found Ogre properly. I always found the FindOGRE.cmake a bit over complicated, but I do one of 2 things.
1) - setup an OGRE_HOME environment variable and set it to the build SDK director ("E:\source\_build\SDK")
2) - pass cmake an extra (using -D cmd line option) "OGRE_SDK" and set it to the build SDK dir as above.
Maybe I misunderstand this OGRE_HOME & OGRE_SDK, so I want to confirm it a bit :D
Here how I setup Ogre SDK:
I clone the Ogre source to E:\Source\OgreSDK
I run CMake and set:
  • Where is the source code: E:\Source\OgreSDK
  • Where to build the binaries: E:\Source\_build\OgreSDK
So I think the environment variables (user variables) should be:
OGRE_HOME = E:\Source\OgreSDK (you said this should be "E:\source\_build\OgreSDK" so I'm a little confuse)
OGRE_SDK = E:\Source\_build\OgreSDK

But even when I has all these environment variables, MyGUI still can't auto-fill all the fields about Ogre :shock:
al2950 wrote:The reason for your compile issue is that it has not set the CMAKE include dirs for the Unlit HLMS, but oddly it has found the libs and dlls. Have you built the 'INSTALL' project properly in Ogre for both release and debug?
Just to be sure, I usually Build all solution for OgreSDK, so technically, the INSTALL project should be built too (If I'm not mistaken :D)
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by al2950 »

I have always used INSTALL, dont ask me why but I have a memory of getting screwed over by all build, so sub consciously always just use INSTALL. Dont take this as gospel but it works for me.

As for the OGRE_HOME and OGRE_SDK they effectively point to the same thing. As I said the FindOGRE.cmake is over complicated and I have never worked out what it is doing. BUT the main way its expected to be used is to have OGRE_HOME as an environment variable set to your build output directory ie "E:\Source\_build\OgreSDK" NOT the source directory.
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by 123iamking »

Hm... After I get tired of MyGUI's CMake, I decide just open Visual Studio and add the 'Addition Include Directory', then manually fix the wrong include path (f.e <Hlms/Unlit/OgreHlmsUnlit.h>, <Hlms/Pbs/OgreHlmsPbs.h>,...) and finally, I get incompatible interface error:

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2660	'Ogre::ResourceGroupManager::initialiseAllResourceGroups': function does not take 0 arguments	Common	E:\Source\mygui\Common\Base\Ogre2\BaseManager.cpp	144	
So I decide to wait for MyGUI :)
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by dermont »

Code: Select all

       /** Initialise all resource groups which are yet to be initialised.
        @see ResourceGroupManager::intialiseResourceGroup
        */
        void initialiseAllResourceGroups( bool changeLocaleTemporarily );
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by al2950 »

Hmmm, It looks like I should probably do an update to mygui and issue a pull request so its compatible with the latest Ogre
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by 123iamking »

al2950 wrote:Hmmm, It looks like I should probably do an update to mygui and issue a pull request so its compatible with the latest Ogre
Thank you Thank you Thank you :D +1 Love
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by al2950 »

FYI I have fixed your issues and just waiting on a pull request.
see here
viewtopic.php?f=25&t=83569&p=539679#p539679
123iamking
Gremlin
Posts: 152
Joined: Sat Aug 12, 2017 4:16 pm
x 4

Re: [2.1] How to compile MyGUI for Ogre 2.1

Post by 123iamking »

al2950 wrote: Tue Nov 07, 2017 10:42 am FYI I have fixed your issues and just waiting on a pull request.
see here
viewtopic.php?f=25&t=83569&p=539679#p539679
I can't thank you enough, Grazie! Ogre 2.1 must have a working GUI library :D
Post Reply