Error Compiling MyGUI

battlepope

04-02-2010 20:20:12

I get the following error when attempting to compile MyGUI 3.0, downloaded from SourceForge. Our OGRE source directories are a bit weird, but we think we've gotten them right. It'd be really useful to know what the default values are for these fields:

OGRE_DIR:
OGRE_INCLUDE_DIR
OGRE_LIBRARIES
OGRE_LIB_DIR

We're also using Ogre 1.8, could that be a problem?

Thanks,
Alissa

[ 46%] Building CXX object Plugins/Plugin_StrangeButton/CMakeFiles/Plugin_StrangeButton.dir/StrangeButton.cpp.o
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Plugins/Plugin_StrangeButton/StrangeButton.cpp:149:22: warning: no newline at end of file
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:24: error: ‘Ogre’ has not been declared
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:24: error: expected `)' before ‘_stream’
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:33: error: ‘Ogre’ has not been declared
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:33: error: ISO C++ forbids declaration of ‘DataStreamPtr’ with no type
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:33: error: expected ‘;’ before ‘mStream’
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp: In member function ‘virtual MyGUI::IDataStream* MyGUI::OgreDataManager::getData(const std::string&)’:
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:67: error: ‘Ogre’ has not been declared
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:67: error: expected `;' before ‘stream’
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:68: error: ‘stream’ was not declared in this scope
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:72: error: expected type-specifier before ‘Ogre’
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:72: error: expected `)' before ‘::’ token
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:72: error: expected `{' before ‘::’ token
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:72: error: ‘::FileNotFoundException’ has not been declared
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:72: error: expected `;' before ‘)’ token
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp: In member function ‘const MyGUI::VectorString& MyGUI::OgreDataManager::getDataListNames(const std::string&, bool)’:
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:95: error: ‘Ogre’ has not been declared
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:95: error: expected `;' before ‘pFileInfo’
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:97: error: ‘pFileInfo’ was not declared in this scope
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:99: error: ‘Ogre’ has not been declared
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:99: error: expected `;' before ‘fi’
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:99: error: ‘fi’ was not declared in this scope
make[2]: *** [Platforms/Ogre/OgrePlatform/CMakeFiles/MyGUI.OgrePlatform.dir/src/MyGUI_OgreDataManager.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:24: error: ‘Ogre’ has not been declared
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:24: error: expected `)' before ‘_stream’
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:33: error: ‘Ogre’ has not been declared
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:33: error: ISO C++ forbids declaration of ‘DataStreamPtr’ with no type
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:33: error: expected ‘;’ before ‘mStream’
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp:14: error: ‘Ogre’ has not been declared
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp:14: error: expected `)' before ‘_stream’
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp: In destructor ‘MyGUI::OgreDataStream::~OgreDataStream()’:
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp:21: error: ‘mStream’ was not declared in this scope
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp: In member function ‘virtual bool MyGUI::OgreDataStream::eof()’:
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp:26: error: ‘mStream’ was not declared in this scope
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp: In member function ‘virtual size_t MyGUI::OgreDataStream::size()’:
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp:31: error: ‘mStream’ was not declared in this scope
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp: In member function ‘virtual void MyGUI::OgreDataStream::readline(std::string&, MyGUI::Char)’:
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp:36: error: ‘mStream’ was not declared in this scope
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp:41: error: ‘mStream’ was not declared in this scope
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp: In member function ‘virtual size_t MyGUI::OgreDataStream::read(void*, size_t)’:
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp:46: error: ‘mStream’ was not declared in this scope
/home/user-pool/users/jw7082/tmp/my-gui/MyGUI3.0/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataStream.cpp:47: error: ‘mStream’ was not declared in this scope
make[2]: *** [Platforms/Ogre/OgrePlatform/CMakeFiles/MyGUI.OgrePlatform.dir/src/MyGUI_OgreDataStream.cpp.o] Error 1
make[1]: *** [Platforms/Ogre/OgrePlatform/CMakeFiles/MyGUI.OgrePlatform.dir/all] Error 2

Altren

04-02-2010 21:04:28

All this errors appeared because Ogre wasn't found. Try to do next things:
- delete previous CMakeCache.txt
- rerun cmake with option:
cmake -DOGRE_DIR=/path/to/your/ogre/directory

Altren

04-02-2010 23:01:54

If this won't help try something like (replace /usr/include/OGRE and /usr/lib/OGRE with proper paths)

cmake -DOGRE_INCLUDE_DIR=/usr/include/OGRE -DOGRE_LIBRARIES="debug;OgreMain_d;optimized;OgreMain" -DOGRE_LIB_DIR=/usr/lib/OGRE
Looks like I need to fix CMake script under linux, right now it can find ogre only in OGRE_HOME or OGRE_SRC and probably can't find it installed.

battlepope

05-02-2010 12:19:21

Thanks very much for the quick reply; it's really nice to find such a well-supported plugin :)

We got further this time!

[ 56%] Building CXX object Platforms/Ogre/OgrePlatform/CMakeFiles/MyGUI.OgrePlatform.dir/src/MyGUI_OgreDataManager.cpp.o
In file included from /home/user-pool/users/jw7082/lib/usr/include/OGRE/Threading/OgreThreadHeaders.h:30,
from /home/user-pool/users/jw7082/lib/usr/include/OGRE/OgreStdHeaders.h:110,
from /home/user-pool/users/jw7082/lib/usr/include/OGRE/OgrePrerequisites.h:315,
from /home/user-pool/users/jw7082/lib/usr/include/OGRE/OgreDataStream.h:31,
from /home/user-pool/users/jw7082/tmp/my-gui/Platforms/Ogre/OgrePlatform/include/MyGUI_OgreDataStream.h:14,
from /home/user-pool/users/jw7082/tmp/my-gui/Platforms/Ogre/OgrePlatform/src/MyGUI_OgreDataManager.cpp:11:
/home/user-pool/users/jw7082/lib/usr/include/OGRE/Threading/OgreThreadHeadersBoost.h:33:41: error: boost/thread/shared_mutex.hpp: No such file or directory
/home/user-pool/users/jw7082/lib/usr/include/OGRE/Threading/OgreThreadHeadersBoost.h:34:34: error: boost/thread/locks.hpp: No such file or directory
/home/user-pool/users/jw7082/lib/usr/include/OGRE/OgreWorkQueue.h:482: error: ‘shared_mutex’ in namespace ‘boost’ does not name a type
make[2]: *** [Platforms/Ogre/OgrePlatform/CMakeFiles/MyGUI.OgrePlatform.dir/src/MyGUI_OgreDataManager.cpp.o] Error 1
make[1]: *** [Platforms/Ogre/OgrePlatform/CMakeFiles/MyGUI.OgrePlatform.dir/all] Error 2
make: *** [all] Error 2


We had a similar error before while compiling something else, that we solved by downloading a new version of boost and pointing the cmake to that new directory. There isn't a place to define the boost library location in the MyGUI cmake, can we add this ourselves or otherwise get around this error?

Thanks,
Alissa.

Altren

06-02-2010 12:17:55

Ok, let me fix this. Looks like Ogre with enabled boost require paths to boost, so I'll add option to add boost includes.
Just never used Ogre with boost before.

battlepope

08-02-2010 10:09:53

Thanks very much for putting that in for us, that's awesome :)
Do you know how long it'll take? We're trying to get MyGUI compiled and integrated as soon as possible :)

Alissa

Altren

08-02-2010 22:49:17

I commited everything, if you using code from trunk - just update. Else you can download sources there: http://my-gui.svn.sourceforge.net/viewv ... z?view=tar

I'm not sure, but may be it is also necessary to add -DOGRE_CONFIG_THREAD_PROVIDER=1 to get required inluded and linker flags.

battlepope

15-02-2010 12:38:30

It works, thank you.

souvarine

12-03-2010 10:52:41

I tried to compile MyGUI 3.0.1 on Linux using Ogre static library. It didn't work out of the box.

First cmake couldn't find Ogre. I had to add an entry OGRE_STATIC into cmake gui and set it to true.
Then cmake told me some dependencies required by ogre were not found. I had to copy the files FindFreeImage.cmake and FindZLIB.cmake from Ogre sources into MyGUI sources.
Finally I had the following compile error

MyGUI_IWidgetFactory.h: In constructor ‘MyGUI::factory::BaseWidgetFactory<T>::BaseWidgetFactory()’:
MyGUI3.0/MyGUIEngine/include/MyGUI_IWidgetFactory.h:60: error: ‘class MyGUI::WidgetManager’ has no member named ‘registerFactory’
MyGUI3.0/MyGUIEngine/include/MyGUI_IWidgetFactory.h: In destructor ‘MyGUI::factory::BaseWidgetFactory<T>::~BaseWidgetFactory()’:
MyGUI3.0/MyGUIEngine/include/MyGUI_IWidgetFactory.h:67: error: ‘class MyGUI::WidgetManager’ has no member named ‘unregisterFactory’

It happened because I had enabled MYGUI_DONT_USE_OBSOLETE, I disabled it and now it compile ok.

Still, the new cmake build system is great, even with these little problems it's much better than before :D