[SOLVED] Help Building CEGUI for OGRE 1.9

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

MikeSwartz
Just popping in
Just popping in
Posts: 13
Joined: Mon Aug 05, 2013 16:31

[SOLVED] Help Building CEGUI for OGRE 1.9

Postby MikeSwartz » Mon Aug 05, 2013 17:02

I have been trying to get CEGUI built for OGRE 1.9 on VS2010 x64 by following the instructions for CEGUI 8.x on Windows here :
http://www.cegui.org.uk/wiki/index.php/Building_CEGUI_for_Ogre_/_OgreRenderer

First, I built the dependencies and moved the dependencies folder to the cegui-0.8.2 folder. This appeared to go smoothly, I didn't change anything just let it do the defaults options for building.

Next I did the first Cmake Configure on the cegui lib, followed the instructions for checking CEGUI RENDERER OGRE and the OGRE_FOUND, OGRE_INCLUDE_DIR and OGRE_LIBRARIES values.

NOTE: One question here, Ogre has an OgreMain.dll for release and an OgreMain_d.dll for debug as noted in the tutorial, however it doesn't say what to do about this. What am I supposed to do for this? I just specified OGRE_LIBRARIES as the release version dll on this attempt.

Finally I run configure again, and this is my output:

Could NOT find MINIZIP (missing: MINIZIP_LIB MINIZIP_LIB_DBG MINIZIP_H_PATH)
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Could NOT find FRIBIDI (missing: FRIBIDI_FOUND_ALL_LIBS FRIBIDI_FOUND_ALL_LIBS_DBG FRIBIDI_INCLUDE_DIR)
Could NOT find IRRLICHT (missing: IRRLICHT_LIB IRRLICHT_H_PATH)
Could NOT find OGRE (missing: OGRE_LIB OGRE_H_PATH)
Could NOT find OIS (missing: OIS_LIB OIS_H_PATH)
Could NOT find DIRECTFB (missing: DIRECTFB_LIB DIRECTFB_LIB_DBG DIRECTFB_H_PATH)
Could NOT find OPENGLES (missing: OPENGLES_LIB OPENGLES_H_PATH)
Could NOT find XERCESC (missing: XERCESC_LIB XERCESC_LIB_DBG XERCESC_H_PATH)
Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
Could NOT find TINYXML (missing: TINYXML_LIB TINYXML_LIB_DBG TINYXML_H_PATH)
Could NOT find RAPIDXML (missing: RAPIDXML_H_PATH)
Could NOT find IL (missing: IL_LIB IL_LIB_DBG IL_H_PATH)
Could NOT find ILU (missing: ILU_LIB ILU_LIB_DBG)
Could NOT find FREEIMAGE (missing: FREEIMAGE_LIB FREEIMAGE_LIB_DBG FREEIMAGE_H_PATH)
Could NOT find CORONA (missing: CORONA_LIB CORONA_LIB_DBG CORONA_H_PATH)
Could NOT find PVRTOOLS (missing: PVRTOOLS_LIB PVRTOOLS_H_PATH)
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
Could NOT find Boost
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Some or all of the gtk libraries were not found. (missing: GTK2_GTK_LIBRARY GTK2_GTK_INCLUDE_DIR GTK2_GLIB_INCLUDE_DIR GTK2_GLIBCONFIG_INCLUDE_DIR GTK2_GLIB_LIBRARY GTK2_GDK_INCLUDE_DIR GTK2_GDKCONFIG_INCLUDE_DIR GTK2_GDK_LIBRARY)
Configuring done

Is this right? For this attempt I went ahead and continued and hit generate, opened the cegui.sln, and ran in to a few more questions.


It says for CEGUIOgreRenderer to add BOOST_ROOT to additional include directories (ConfigProps->C/C++->AdditionalIncludeDirectories I assume), and to add libraries to additional library directories. Now for me I have Boost_FILESYSTEM_LIBRARY and Boost_REGEX_LIBRARY. Is this what the additional library directories are? Not sure here. Anyway, I added both of those to additional library directories in the linker section. Is this correct? If not what do I do?

Then I built the project on debug and got these errors.

Error 127 error LNK1107: invalid or corrupt file: cannot read at 0x320 C:\Shared\OGRE_SNAPSHOT\OGRE-SDK-1.9.0-vc100-amd64-18.04.2013\bin\Release\OgreMain.dll 1 1 CEGUIOgreRenderer-0

Error 129 error C1083: Cannot open include file: 'boost/thread/tss.hpp': No such file or directory c:\shared\ogre_snapshot\ogre-sdk-1.9.0-vc100-amd64-18.04.2013\include\ogre\threading\OgreThreadHeadersBoost.h 37 1 CEGUISampleFramework-0.8

Error 137 error C1083: Cannot open include file: 'boost/thread/tss.hpp': No such file or directory c:\shared\ogre_snapshot\ogre-sdk-1.9.0-vc100-amd64-18.04.2013\include\ogre\threading\OgreThreadHeadersBoost.h 37 1 CEGUISampleFramework-0.8

Error 31 error C2065: 'CEGUI_NEW' : undeclared identifier C:\Shared\OGRE_SNAPSHOT\cegui-0.8.2\cegui\src\RendererModules\Direct3D10\Renderer.cpp 60 1 CEGUIDirect3D10Renderer-0

Error 32 error C2143: syntax error : missing ';' before 'CEGUI::DefaultResourceProvider' C:\Shared\OGRE_SNAPSHOT\cegui-0.8.2\cegui\src\RendererModules\Direct3D10\Renderer.cpp 60 1 CEGUIDirect3D10Renderer-0


I'm sure I went wrong in multiple spots, hopefully someone can help me out here.

Thanks in advance.


UPDATE: I used the precompiled libraries from transporter on the ogre forums.
Last edited by MikeSwartz on Mon Aug 12, 2013 16:41, edited 2 times in total.

MikeSwartz
Just popping in
Just popping in
Posts: 13
Joined: Mon Aug 05, 2013 16:31

Re: Help Building CEGUI for OGRE 1.9

Postby MikeSwartz » Mon Aug 05, 2013 18:33

UPDATE:

Found I forgot to include the boost stuff in the CEGUISampleFramework,

After that I get the following errors:

Error 116 error LNK1107: invalid or corrupt file: cannot read at 0x320 C:\Shared\OGRE_SNAPSHOT\OGRE-SDK-1.9.0-vc100-amd64-18.04.2013\bin\Release\OgreMain.dll 1 1 CEGUIOgreRenderer-0

Error 27 error C2143: syntax error : missing ';' before 'CEGUI::DefaultResourceProvider' C:\Shared\OGRE_SNAPSHOT\cegui-0.8.2\cegui\src\RendererModules\Direct3D10\Renderer.cpp 60 1 CEGUIDirect3D10Renderer-0

Error 26 error C2065: 'CEGUI_NEW' : undeclared identifier C:\Shared\OGRE_SNAPSHOT\cegui-0.8.2\cegui\src\RendererModules\Direct3D10\Renderer.cpp 60 1 CEGUIDirect3D10Renderer-0

Error 126 error C1083: Cannot open include file: 'OIS.h': No such file or directory C:\Shared\OGRE_SNAPSHOT\cegui-0.8.2\samples_framework\include\CEGuiOgreBaseApplication.h 36 1 CEGUISampleFramework-0.8

MikeSwartz
Just popping in
Just popping in
Posts: 13
Joined: Mon Aug 05, 2013 16:31

Re: Help Building CEGUI for OGRE 1.9

Postby MikeSwartz » Mon Aug 05, 2013 18:55

UPDATE:

Added the filepath and include stuff for OIS and am now faced with these errors.

Error 29 error C2065: 'CEGUI_NEW' : undeclared identifier C:\Shared\OGRE_SNAPSHOT\cegui-0.8.2\cegui\src\RendererModules\Direct3D10\Renderer.cpp 60 1 CEGUIDirect3D10Renderer-0

Error 30 error C2143: syntax error : missing ';' before 'CEGUI::DefaultResourceProvider' C:\Shared\OGRE_SNAPSHOT\cegui-0.8.2\cegui\src\RendererModules\Direct3D10\Renderer.cpp 60 1 CEGUIDirect3D10Renderer-0

Error 146 error LNK1104: cannot open file '..\lib\CEGUIOgreRenderer-0_d.lib' C:\Shared\OGRE_SNAPSHOT\cegui-0.8.2\build\samples_framework\LINK CEGUISampleFramework-0.8

Error 131 error LNK1107: invalid or corrupt file: cannot read at 0x320 C:\Shared\OGRE_SNAPSHOT\OGRE-SDK-1.9.0-vc100-amd64-18.04.2013\bin\Release\OgreMain.dll 1 1 CEGUIOgreRenderer-0

Jefferian
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Wed May 08, 2013 21:55

Re: Help Building CEGUI for OGRE 1.9

Postby Jefferian » Tue Aug 06, 2013 02:44

Uh...just a question beforehand. You do know there are prebuilt SDKs and plugins -like cegui - built by Transporter and available via this thread in the Ogre forums, right?
http://www.ogre3d.org/forums/viewtopic.php?t=69274

MikeSwartz
Just popping in
Just popping in
Posts: 13
Joined: Mon Aug 05, 2013 16:31

Re: Help Building CEGUI for OGRE 1.9

Postby MikeSwartz » Tue Aug 06, 2013 13:34

That seems pretty helpful, any idea how to just extract CEGUI from that? There are a lot of other plugins there.

tyrolite
Just popping in
Just popping in
Posts: 5
Joined: Mon Jul 08, 2013 20:07

Re: Help Building CEGUI for OGRE 1.9

Postby tyrolite » Tue Aug 06, 2013 14:21

I wrote the tutorial for CEGUI 0.8.x and I have to admit that it's a bit ambiguous .

MikeSwartz wrote:NOTE: One question here, Ogre has an OgreMain.dll for release and an OgreMain_d.dll for debug as noted in the tutorial, however it doesn't say what to do about this. What am I supposed to do for this? I just specified OGRE_LIBRARIES as the release version dll on this attempt.

Finally I run configure again, and this is my output:

...
Could NOT find OGRE (missing: OGRE_LIB OGRE_H_PATH)
Could NOT find OIS (missing: OIS_LIB OIS_H_PATH)
...
Could NOT find Boost
...
Configuring done

Is this right? For this attempt I went ahead and continued and hit generate, opened the cegui.sln, and ran in to a few more questions.


AFAIK, when cmake tries to find a package, it launches a script that starts with "Find" followed by the package name so when it tries to find OGRE, cmake will run the "FindOGRE.cmake" script(found in cegui-0.8.2/cmake). When I saw that cmake didn't found my ogre stuff, I opened FindOGRE.cmake to see what variables I have to set manually. After I set them, I had to run Configure again to save these values to CMake cache.

When you run Configure for the second time, cmake will run again the "Find..." scripts and will say again that it didn't found your packages even if you've set those variables correctly. When you run Generate, cmake will take the values from its cache and will use the libraries you specified. You can verify this by looking in the project properties of CEGUIOgreRenderer-0->Linker->Command Line. I've only built a static/release cegui on my machine so I set the OGRE_LIBRARIES to the static release version of Ogre, that is OgreMain.lib . Now that you mentioned about the debug version, I've looked again in FindOGRE.cmake and saw that there is another variable OGRE_LIBRARIES_DBG which is probably used for debug builds. I don't know what are the cmake "best practices" regarding these *_LIBRARIES variables because I've seen some scripts dumping debug and release libraries into a single variable, separated by commas.

So, if you only want dynamic/release cegui libraries then set OGRE_LIBRARIES to OgreMain.dll, select the release solution configuration in Visual Studio and then add those boost includes and libs to the projects. If you want to switch between release/debug in Visual Studio or just build the debug libraries then set OGRE_LIBRARIES to OgreMain.dll and OGRE_LIBRARIES_DBG to OgreMain_d.dll . You should do the same thing for OIS and Boost.

If you set OGRE_LIBRARIES to OgreMain.dll and you selected the release solution configurarion in Visual Studio, then it should be right.

MikeSwartz wrote:It says for CEGUIOgreRenderer to add BOOST_ROOT to additional include directories (ConfigProps->C/C++->AdditionalIncludeDirectories I assume), and to add libraries to additional library directories. Now for me I have Boost_FILESYSTEM_LIBRARY and Boost_REGEX_LIBRARY. Is this what the additional library directories are? Not sure here. Anyway, I added both of those to additional library directories in the linker section. Is this correct? If not what do I do?


After I wasted some time with the weird boost build system, I decided to use precompiled boost libraries for msvc 2010, found here: https://sourceforge.net/projects/boost/files/boost-binaries/1.54.0/ . I've installed these binaries in their default location(C:\local\boost_1_54_0). After that I saw that there is a folder "lib-msvc-10.0-64" and I renamed this to just "lib" so cmake can find it at the first Configure. In this lib folder are all the possible boost libraries(static, dynamic, debug, release..). This is the boost libs folder I added to the additional libraries.

MikeSwartz wrote:Then I built the project on debug and got these errors.

Error 127 error LNK1107: invalid or corrupt file: cannot read at 0x320 C:\Shared\OGRE_SNAPSHOT\OGRE-SDK-1.9.0-vc100-amd64-18.04.2013\bin\Release\OgreMain.dll 1 1 CEGUIOgreRenderer-0

Error 129 error C1083: Cannot open include file: 'boost/thread/tss.hpp': No such file or directory c:\shared\ogre_snapshot\ogre-sdk-1.9.0-vc100-amd64-18.04.2013\include\ogre\threading\OgreThreadHeadersBoost.h 37 1 CEGUISampleFramework-0.8

Error 137 error C1083: Cannot open include file: 'boost/thread/tss.hpp': No such file or directory c:\shared\ogre_snapshot\ogre-sdk-1.9.0-vc100-amd64-18.04.2013\include\ogre\threading\OgreThreadHeadersBoost.h 37 1 CEGUISampleFramework-0.8

Error 31 error C2065: 'CEGUI_NEW' : undeclared identifier C:\Shared\OGRE_SNAPSHOT\cegui-0.8.2\cegui\src\RendererModules\Direct3D10\Renderer.cpp 60 1 CEGUIDirect3D10Renderer-0

Error 32 error C2143: syntax error : missing ';' before 'CEGUI::DefaultResourceProvider' C:\Shared\OGRE_SNAPSHOT\cegui-0.8.2\cegui\src\RendererModules\Direct3D10\Renderer.cpp 60 1 CEGUIDirect3D10Renderer-0


You probably get the "invalid or corrupt file" linker error because you use the release OgreMain.dll library and your solution configuration for cegui is set to debug.
As for the errors regarding CEGUIDirect3D10Renderer-0, I suggest to disable building the Direct3D renderer if you only use the Ogre renderer. There should be a variable CEGUI_BUILD_RENDERER_DIRECT3D or something like that and you can set it to FALSE before you run again Configure.

The build process would be a lot more easier if the 'Find...' cmake scripts did their job in the first place and Ogre wouldn't forward the boost dependency to CEGUI.
I'll try to make a dynamic/debug build for cegui and update the tutorial.

tyrolite
Just popping in
Just popping in
Posts: 5
Joined: Mon Jul 08, 2013 20:07

Re: Help Building CEGUI for OGRE 1.9

Postby tyrolite » Fri Aug 09, 2013 11:08

UPDATE:

I did a bit of research and I found out what's with the linker LNK1107 error. It seems that if you want to use the dynamic libraries, you still have to link against the "*.lib" files which act as "import libraries" and point to the actual dlls. You can read more on the wiki: https://en.wikipedia.org/wiki/Dynamic-link_library#Import_libraries

This means that when I did my build and set OGRE_LIBRARIES to OgreMain.lib, I was actually using the dynamic libraries. If, for some reason, you want to use a static build of ogre then you need to get and OgreSDK compiled with the OGRE_STATIC option or just build one from sources. Similar if you want a static build of CEGUI, you need to set the CEGUI_BUILD_STATIC_CONFIGURATION.

So, if someone needs to set cmake variables manually then OGRE_LIBRARIES must be a filepath to OGRE_HOME/lib/release/OgreMain.lib and OGRE_LIBRARIES_DBG must be a filepath to OGRE_HOME/lib/debug/OgreMain_d.lib .

MikeSwartz
Just popping in
Just popping in
Posts: 13
Joined: Mon Aug 05, 2013 16:31

Re: Help Building CEGUI for OGRE 1.9

Postby MikeSwartz » Mon Aug 12, 2013 16:40

Thanks for your help everybody, hopefully this is useful for somebody, but for now I am just going with the precompiled version from Transporter.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 33 guests