Example file ogre3d+myGUI

doDo

15-01-2012 21:36:07

Hello everyone.

I'm sitting at my little project for 7 days and I am getting depressed because constantly something is not working as it should. My config is win7 x86, ogre3d 1.7.3 prebuilt + myGUI 3.2 RC1 + visual studio 2010.


I'd like to ask you guys for some favor. I need to learn to how should looks the final release application (Ogre3D + myGUI). It's enough it will be standard ogre framework build by ogre3d wizard and added to it code and files from myGUI with standard layout.

I've read all that stuff from ..tikiwiki/MyGUI but I still cannot find ready example or sth. Those remarks are not fully understood to me. I am at stage appling myGUI to ogre3d.

That's how I include and initialise myGUI in my project.
MyGUI::Gui* mGUI;
MyGUI::OgrePlatform* mPlatform = new MyGUI::OgrePlatform();
mPlatform->initialise(mWindow, mSceneMgr); // mWindow is Ogre::RenderWindow*, mSceneManager is Ogre::SceneManager*
mGUI = new MyGUI::Gui();
mGUI->initialise("moje_gui.xml");


And after build, VS throws this:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>MojOgor1.obj : warning LNK4217: locally defined symbol ?initialise@Gui@MyGUI@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z (public: void __thiscall MyGUI::Gui::initialise(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)) imported in function "protected: virtual void __thiscall MojOgor1::createScene(void)" (?createScene@MojOgor1@@MAEXXZ)
1>MojOgor1.obj : warning LNK4217: locally defined symbol ??0Gui@MyGUI@@QAE@XZ (public: __thiscall MyGUI::Gui::Gui(void)) imported in function "protected: virtual void __thiscall MojOgor1::createScene(void)" (?createScene@MojOgor1@@MAEXXZ)
1>MojOgor1.obj : warning LNK4217: locally defined symbol ??0LogManager@MyGUI@@QAE@XZ (public: __thiscall MyGUI::LogManager::LogManager(void)) imported in function "public: __thiscall MyGUI::OgrePlatform::OgrePlatform(void)" (??0OgrePlatform@MyGUI@@QAE@XZ)
1>MojOgor1.obj : warning LNK4217: locally defined symbol ?createDefaultSource@LogManager@MyGUI@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z (public: void __thiscall MyGUI::LogManager::createDefaultSource(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)) imported in function "public: void __thiscall MyGUI::OgrePlatform::initialise(class Ogre::RenderWindow *,class Ogre::SceneManager *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?initialise@OgrePlatform@MyGUI@@QAEXPAVRenderWindow@Ogre@@PAVSceneManager@4@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2@Z)
1>MojOgor1.obj : warning LNK4217: locally defined symbol ?getInstance@LogManager@MyGUI@@SAAAV12@XZ (public: static class MyGUI::LogManager & __cdecl MyGUI::LogManager::getInstance(void)) imported in function "public: void __thiscall MyGUI::OgrePlatform::initialise(class Ogre::RenderWindow *,class Ogre::SceneManager *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?initialise@OgrePlatform@MyGUI@@QAEXPAVRenderWindow@Ogre@@PAVSceneManager@4@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2@Z)
1>MojOgor1.obj : warning LNK4217: locally defined symbol ??1Gui@MyGUI@@UAE@XZ (public: virtual __thiscall MyGUI::Gui::~Gui(void)) imported in function "public: virtual void * __thiscall MyGUI::Gui::`scalar deleting destructor'(unsigned int)" (??_GGui@MyGUI@@UAEPAXI@Z)
1>MyGUIEngineStatic_d.lib(MyGUI_ResourceTrueTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Done_FreeType referenced in function "private: void __thiscall MyGUI::ResourceTrueTypeFont::initialise(void)" (?initialise@ResourceTrueTypeFont@MyGUI@@AAEXXZ)
1>MyGUIEngineStatic_d.lib(MyGUI_ResourceTrueTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Load_Char referenced in function "private: void __thiscall MyGUI::ResourceTrueTypeFont::initialise(void)" (?initialise@ResourceTrueTypeFont@MyGUI@@AAEXXZ)
1>MyGUIEngineStatic_d.lib(MyGUI_ResourceTrueTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Set_Char_Size referenced in function "private: void __thiscall MyGUI::ResourceTrueTypeFont::initialise(void)" (?initialise@ResourceTrueTypeFont@MyGUI@@AAEXXZ)
1>MyGUIEngineStatic_d.lib(MyGUI_ResourceTrueTypeFont.obj) : error LNK2019: unresolved external symbol _FT_New_Memory_Face referenced in function "private: void __thiscall MyGUI::ResourceTrueTypeFont::initialise(void)" (?initialise@ResourceTrueTypeFont@MyGUI@@AAEXXZ)
1>MyGUIEngineStatic_d.lib(MyGUI_ResourceTrueTypeFont.obj) : error LNK2019: unresolved external symbol _FT_Init_FreeType referenced in function "private: void __thiscall MyGUI::ResourceTrueTypeFont::initialise(void)" (?initialise@ResourceTrueTypeFont@MyGUI@@AAEXXZ)
1>bin\Debug\\MojOgor1.exe : fatal error LNK1120: 5 unresolved externals
1>
1>Build FAILED.




+ I attach my files and without BaseApplication's.
.h - http://pastebin.com/uepGDerP
.cpp - http://pastebin.com/KZqssUuY

Spire

16-01-2012 05:27:14

You need to link against the FreeType library. You can do this by adding a reference to this library (e.g., FreeType.lib) to the list of Additional Dependencies under the Linker | Input page of your project's properties.

Altren

16-01-2012 08:19:29

You also need to link freetype2311_d.lib / freetype2311.lib (or whatever version you have) when you use static MyGUI build.

Also I added this info to wiki page.

doDo

16-01-2012 09:46:00

Ad1. It helps indeed, I thought that libs (freetype) was included earlier. Thanks :)

Ad2. I have only one more question. In Quickstart MyGUI there is wrote:
Before you initialize the GUI, be sure to create a viewport. This is sent to the OgrePlatform class and stores it for use later during the "initialise" method call.

How should I unerdstand this? I need additional viewport for myGUI or I just need to remeber that all ogre project needs a viewport, one for all in this case?

Altren

16-01-2012 21:07:55

How should I unerdstand this? I need additional viewport for myGUI or I just need to remeber that all ogre project needs a viewport, one for all in this case?You don't need an additional viewport, but in case if you have Ogre::RenderWindow and Ogre::SceneManagers, but not created any viewports yet.

frostbytes89

01-04-2012 04:18:35

Hey, I'm sorry I don't have input on how to fix your problem but how in the world did you even get it to work on visual studio 2010?! I can't find how anywhere! All I've seen is that stupid cmake tutorial which btw I can't get to work to save my life. I need this GUI so bad but it's so poorly documented on how to actually get it up and running.

Can somebody PLEASE help me with this.