MyGUI.OgrePlatform Compile...

mLichy

22-01-2011 19:16:39

Hi,

I have been trying to compile myGui for the past couple of days,and I cannot get this thing compiled... :(.

I have been following the, http://www.ogre3d.org/tikiwiki/MyGUI+Compiling tutorial.

I've gotten up to the point where I am supposed to compile the myGUIEngine and myGUI.OgrePlatform.
I've been able to compile, so it says, the myGUIEngine, but when I try to compile the
myGUI.OgrePlatform, I keep getting errors with Boost, and cannot get any further.

It keeps saying it can't find for example, select_compiler_config.hpp.

Does anyone know why I can't get this working... It's driving me insane...


Thanks!

-Matt

Altren

22-01-2011 19:20:14

Finding boost include directory is somewhat tricky. What version of MyGUI do you use?
Set BOOST_ROOT path in CMake if you haven't done it yet.

mLichy

22-01-2011 19:48:50

Thank you for the fast reply. I am using 3.0.1.

I don't think I set the boost in Cmake, I can try that. I will get back to you.

Thanks!

mLichy

22-01-2011 20:15:54

I don't have a Boost option in my cMake. Should I create one?

Altren

22-01-2011 20:32:03

Yes, create it.

mLichy

22-01-2011 20:40:55

Ok, so just do BOOST_ROOT then set the path to my "C:\OgreSDK_vc10_v1-7-2\boost_1_42" ?


Edit: I tried that, and still doesn't work :(. Damn u boost!

Garthy

23-01-2011 22:17:49

I might be able to help.

Firstly, I'd check to see if you can make it work with "BOOST_ROOT" first if you can. It's a lot easier than what I'm about to suggest!

If it really won't work, then read on. My build environment is somewhat different from yours so I'm having to guess a few of these steps, but it might help.

Firstly:

- Am I correct in assuming you're using the prebuild Ogre SDK, ie. you didn't build it from source? If you built Ogre from source, don't proceed, let me know and I'll adjust the instructions.

- Am I correct that the errors you are seeing are with respect to a whole bunch of boost headers (generally *.hpp files) not being found, possibly whilst it was trying out something related to Ogre?

Now, in the instructions that follow, don't include quotation marks in any of the steps, they are just there to make it clear which bits are critical.

Anyway, assuming the above, another way to get MyGUI (actually CMake) to recognise the boost headers is to pass them in in the "CMAKE_CXX_FLAGS" and "CMAKE_EXE_LINKER_FLAGS" variables. From your screenshot, it looks like those two aren't set yet (this is good), so the following might work:

Go into wherever boost is, and find a directory called "boost" that contains lots of directories and lots of "hpp" files. You'll know you're in the right place if one of the files is "shared_ptr.hpp". Note down this directory name. Based on your info so far, it is probably "c:\ogresdk_vc10_v1-7-2\boost_1_42". Create a new variable called "CMAKE_CXX_FLAGS", and set it to this value, changing all "\" characters into "/". Put a "/I" at the very front (that's a slash followed by a capital "i"). For you, the result is likely: "/Ic:/ogresdk_vc10_v1-7-2/boost_1_42".

Then look for a bunch of "lib" files. One is probably "libboost_date_time-vc100-mt-1_42.lib" or similar. Note down this directory name. For you, it is probably "c:\ogresdk_vc10_v1-7-2\boost_1_42\lib". Create a new variable "CMAKE_EXE_LINKER_FLAGS" and set it to this value, again changing all "\" characters into "/". Put "/LIBPATH:" out the front. For you, the result it is likely: "/LIBPATH:c:/ogresdk_vc10_v1-7-2/boost_1_42/lib".

If it doesn't work, let me know the point at which it breaks or you get stuck, and the details, and I'll see if I can offer any more suggestions.

I am using an approach similar to this a fairly recent subversion, 3.2.0rc1, and I used it with 3.0.1. It works with all three. However, I am using a fairly different build environment (VC9, Ogre and Boost built from source, and cmake form the commandline). Some details will almost certainly differ from your setup.

I hope this helps...

Garthy

23-01-2011 22:41:44

Hang on a sec, crazy thought, ignore my above post for the moment and try this first:

Remove "BOOST_ROOT" if it's there:

- Select "BOOST_ROOT".
- Click "Remove Entry".

Add it again:

- Click "Add Entry".
- For type, select "Path".
- Click the browse button (it's the "..." next to the value).
- Go to "C:\OgreSDK_vc10_v1-7-2\boost_1_42" (don't type it in, actually browse there).
- Note that it appears as "C:/OgreSDK_vc10_v1-7-2/boost_1_42".
- Ok
- Ok

Does this solve it?

mLichy

24-01-2011 00:29:03

Hey,

Thanks alot for taking the time to write all of that .

I tried both, and neither worked :(.

My Boost folder is setup different than you said, but I don't if that matters?
Mine would be, C:\OgreSDK_vc10_v1-7-2\boost_1_42\boost , where all of the .hpp files are.

When u said to try the CMAKE stuff, you meant add those as entries in Cmake? I did that, and after I hit configure, it removed the entries.

When I compile in VS, this is what I always get.



Edit: I setup Ogre starting with this, http://www.ogre3d.org/tikiwiki/Installing+the+Ogre+SDK

Thanks alot for helping :)

Garthy

24-01-2011 01:02:03

Hey,
Thanks alot for taking the time to write all of that .


Not a problem.


My Boost folder is setup different than you said, but I don't if that matters?
Mine would be, C:\OgreSDK_vc10_v1-7-2\boost_1_42\boost , where all of the .hpp files are.


I've edited my (large) post above to match your environment. I had guessed incorrectly. ;) You shouldn't include the last "boost" directory, by the way, it should stop at "boost_1_42". However, let's leave the complicated approach for now and make sure we've tried everything with the easy one. :)

Could you set "BOOST_ROOT" as indicated in my shorter post, but don't hit "Configure" yet, then post a screencap of your CMake setup again, sized appropriately to show all of the variables you have set?


When u said to try the CMAKE stuff, you meant add those as entries in Cmake?


Yes. Use "Add Entry". The type should be "String" for the two entries in the big post. But we'll only try the harder approach later if we can't get the easy one working. :)


When I compile in VS, this is what I always get.


Thanks, that's given me some additional information that will help.

mLichy

24-01-2011 01:17:14

Here is what CMake looks like,

Garthy

24-01-2011 01:35:25

Firstly, make sure Visual Studio is not running.

Next thing to do would be to hit "Configure". If there are errors (I suspect it'll complain about freetype), then paste them here. For now, just uncheck "MYGUI_USE_FREETYPE" and try again (this is normally a bad idea, but we'll do it for now). If you get errors, again, paste them here. If not, hit "Generate".

Then go into the directory where you've told it to build the binaries (see the line "Where to build the binaries"), open "MYGUI.sln", and try to build it. Don't open anything else from any other directory!

mLichy

24-01-2011 01:52:17

Yea, I was getting Freetype issues, but I fixed that.

This is what it looks like when I do a build with Freetype on.

Configuring MYGUI 3.0.1
Looking for FREETYPE...
Found FREETYPE: optimized;C:/OgreSDK_vc10_v1-7-2/Dependencies/lib/release/freetype2311.lib;debug;C:/OgreSDK_vc10_v1-7-2/Dependencies/lib/debug/freetype2311_d.lib
Looking for OGRE...
Found Ogre Cthugha (1.7.2)
Found OGRE: optimized;C:/OgreSDK_vc10_v1-7-2/lib/release/OgreMain.lib;debug;C:/OgreSDK_vc10_v1-7-2/lib/debug/OgreMain_d.lib
Looking for OGRE_Paging...
Found OGRE_Paging: optimized;C:/OgreSDK_vc10_v1-7-2/lib/release/OgrePaging.lib;debug;C:/OgreSDK_vc10_v1-7-2/lib/debug/OgrePaging_d.lib
Looking for OGRE_Terrain...
Found OGRE_Terrain: optimized;C:/OgreSDK_vc10_v1-7-2/lib/release/OgreTerrain.lib;debug;C:/OgreSDK_vc10_v1-7-2/lib/debug/OgreTerrain_d.lib
Looking for OGRE_Property...
Found OGRE_Property: optimized;C:/OgreSDK_vc10_v1-7-2/lib/release/OgreProperty.lib;debug;C:/OgreSDK_vc10_v1-7-2/lib/debug/OgreProperty_d.lib
Looking for OGRE_RTShaderSystem...
Found OGRE_RTShaderSystem: optimized;C:/OgreSDK_vc10_v1-7-2/lib/release/OgreRTShaderSystem.lib;debug;C:/OgreSDK_vc10_v1-7-2/lib/debug/OgreRTShaderSystem_d.lib
Looking for OIS...
Found OIS: optimized;C:/OgreSDK_vc10_v1-7-2/Dependencies/lib/release/OIS.lib;debug;C:/OgreSDK_vc10_v1-7-2/Dependencies/lib/debug/OIS_d.lib
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)

-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
+ freetype
+ ogre
+ OIS
-----------------------------------------------------------------------------
-- The following OPTIONAL packages could NOT be located on your system.
-- Consider installing them to enable more features from this software.
+ Doxygen: Tool for building API documentation <http://doxygen.org>
-----------------------------------------------------------------------------

Configuring done

Garthy

24-01-2011 01:56:50

Looks good! Now, hit "Generate", and go into the directory where you've told it to build the binaries (see the line "Where to build the binaries"), open "MYGUI.sln", and try to build it. Don't open anything else from any other directory!

What happens next?

(Incidentally, I assume the fix you mention was to set MYGUI_DEPENDENCIES_DIR, or did you do it another way?)

mLichy

24-01-2011 02:04:58

Get the same exact error as usual..... cannot open include file:'boost/thread/tss.hpp'

Garthy

24-01-2011 02:19:32

I was so sure you'd say "it all works now". Drat! ;)

Let's try:

Close Visual Studio.

Open CMake again:

- Check "Advanced".
- Click "Add Entry".
- Name: "CMAKE_CXX_FLAGS".
- Type: "String".
- Enter "/Ic:/ogresdk_vc10_v1-7-2/boost_1_42", no quotes. That's a slash, a capital "i", no space, and then the path to boost, without the last "boost", and forward slashes rather than backslashes..
- Ok
- Ok
- Uncheck "Advanced".

Configure
Generate
Open project again, rebuild.

If it's working, the Boost errors will go away. The build probably won't complete 100%, but the important thing is getting past the boost errors.

mLichy

24-01-2011 02:25:15

I DID IT! Ha! Still need to attempt to link it into my Project file... but I did it.

I thought I tried this before, but I think it was because I had to include the root directory of Boost and not the boost folder inside of that one.

So the way I fixed it was, in Debug and Release, I went into the C++ General and set it up like this, for the myGUI Ogre Platform




Thanks again!

Garthy

24-01-2011 02:36:40

Congratulations!

If you similarly run into linker errors at some point, be sure to add "c:/ogresdk_vc10_v1-7-2/boost_1_42/lib" to the list of library directories as well.

Also: If you edit the include/library directories for the MyGUI project in this way, it'll be overwritten by CMake the next time you hit Generate, so be careful if you do this!

The last step of the approach I was recommending above was to also add "CMAKE_EXE_LINKER_FLAGS" and set it to "/LIBPATH:c:/ogresdk_vc10_v1-7-2/boost_1_42/lib".

You can also set the include and library directories for all projects in Visual Studio in a similar way through Tools / Options / Projects and Solutions / VC++ Directories, and selecting entries from the dropdown box on the right. In this way you only need to do it once, but it'll affect everything you build with Visual Studio, so you need to keep that in mind. :)

mLichy

24-01-2011 02:41:42

Awesome, thanks for the info. :)

I started looking at this page, http://www.ogre3d.org/tikiwiki/MyGUI+quickstart

I added the includes, and it loaded in files fine without issue. But now, that tutorial doesn't say where to put those commands.

I tried added them into my CreateScene function, and it gives errors about mSceneManager.

Garthy

24-01-2011 03:02:47

Awesome, thanks for the info. :)


Not a problem.


I started looking at this page, http://www.ogre3d.org/tikiwiki/MyGUI+quickstart

I added the includes, and it loaded in files fine without issue. But now, that tutorial doesn't say where to put those commands.

I tried added them into my CreateScene function, and it gives errors about mSceneManager.


Stepping through integrating MyGUI into your project is a pretty big thing so I can't personally offer to do that specifically, but a few tips:

- I'm assuming you've got a basic Ogre application set up already. If not, start there. :) There are (vast!) Ogre tutorials on how to get to this point.

- For mSceneManager, somewhere you should have a Ogre::SceneManager*, that's what you need to pass in.

- You should initialise MyGUI after initialising Ogre, but shortly before you call startRendering().

- The inject calls will plug in into your existing code somewhere; the information on that page will be a guide as to where. :) Look for similarly-styled calls. If you don't do this, you won't be able to interact with any GUI elements you create.

- Start out by trying to get just one button up on the screen. Make sure you can press it. Once you can do that, then try the tricky stuff. Always start simple. :)

Good luck!

mLichy

24-01-2011 03:48:59

hmmm... ok. Yeah, I was just planning to try and get 1 button working and go from there :).

I'll have to look around more and see if I can't get this working. Still errors out, but now it's saying

Error 2 error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in BaseApplication.obj C:\Users\MATT\Documents\Visual Studio 2010\Projects\OgreProject\OgreProject\MyGUI.OgrePlatform.lib(MyGUI_OgreRenderManager.obj) OgreProject


But like I said, I can look around and see if I can't get it working. I'm probably doing something wrong yet.

Thanks again

Garthy

24-01-2011 22:54:45

I've never seen that message before myself, so I hit Google for "_ITERATOR_DEBUG_LEVEL". The first two links are pretty useful:

http://stackoverflow.com/questions/4130 ... vel-1-mean
http://msdn.microsoft.com/en-us/library/k3a3hzw7.aspx

as are some of the others further down.

If I had to guess, I'd guess that you're doing a debug build but linking in with the release version of MyGUI. I'd investigate that first. :)

Good luck!

mLichy

25-01-2011 02:42:01

Yep, I realized I had included both the release and debug of the libs.

So I got that all working. Now just to figure out how to use the thing. I may have to learn more about C++ first.. heh. I haven't done C++ before and started doing all of this :P.

Garthy

25-01-2011 02:50:29

I haven't done C++ before and started doing all of this :P.

Now *that's* jumping in in the deep end. ;) Good luck!

juricss

30-04-2012 21:19:10

hi,I'm new to CMake. So I followed the MyGUI tutorial (http://www.ogre3d.org/tikiwiki/MyGUI+Compiling) but I got compile problem with BOOST.
then I found there may be a error in the final section(Solve compile problems with BOOST) of the wiki:
The result is likely: "/Ic:/OgreSDK_vc10_v1-7-4/boost_1_47/lib".
it should be:
The result is likely: "/LIBPATH:c:/OgreSDK_vc10_v1-7-4/boost_1_47/lib".

finally I compiled MyGUI successfully, Thanks for all your work :D .

juricss

30-04-2012 21:22:40

hi,I'm new to CMake. So I followed the MyGUI tutorial (http://www.ogre3d.org/tikiwiki/MyGUI+Compiling) but I got compile problem with BOOST.
then I found there may be a error in the final section(Solve compile problems with BOOST) of the wiki:
The result is likely: "/Ic:/OgreSDK_vc10_v1-7-4/boost_1_47/lib".
it should be:
The result is likely: "/LIBPATH:c:/OgreSDK_vc10_v1-7-4/boost_1_47/lib".

finally I compiled MyGUI successfully, Thanks for all your work :D .