Trouble compiling with MinGW

valistar

17-10-2012 07:21:52

Hello

Having a mess of trouble compiling revision 5163 with MinGW 4.7/CMake 2.8.9, and would appreciate any help. I'll start with the problem I'm stuck on, and tack on the things I've changed to get this far.
I built Ogre 1.8.1 (debug and release) with Boost 1.51 using dependencies built from the source package at https://bitbucket.org/cabalistic/ogredeps/overview (From Oct 15th, currently the most recent)

Building CXX object Tools/LayoutEditor/CMakeFiles/LayoutEditor.dir/ApplicationState.cpp.obj
cd /d F:\ProjectMW\DEPS\MyGUI_3.2.0SRC\debug\Tools\LayoutEditor && F:\MinGW\bin\g++.exe -DMYGUI_OGRE_PLATFORM -DMYGUI_SAMPLES_INPUT_WIN32 -DMYGUI_BUILD -DMYGUI_BUILD_DLL -msse -w -g @CMakeFiles/LayoutEditor.dir/includes_CXX.rsp -o CMakeFiles\LayoutEditor.dir\ApplicationState.cpp.obj -c F:\ProjectMW\DEPS\MyGUI_3.2.0SRC\Tools\LayoutEditor\ApplicationState.cpp
In file included from F:/ProjectMW/DEPS/MyGUI_3.2.0SRC/Tools/EditorFramework/FactoryManager.h:13:0,
from F:\ProjectMW\DEPS\MyGUI_3.2.0SRC\Tools\LayoutEditor\ApplicationState.cpp:9:
F:/ProjectMW/DEPS/MyGUI_3.2.0SRC/Tools/EditorFramework/FactoryTemplate.h: In instantiation of 'components::IFactoryItem* components::FactoryTemplate<Type>::CreateItem() [with Type = tools::ApplicationState]':
F:\ProjectMW\DEPS\MyGUI_3.2.0SRC\Tools\LayoutEditor\ApplicationState.cpp:42:1: required from here
F:/ProjectMW/DEPS/MyGUI_3.2.0SRC/Tools/EditorFramework/FactoryTemplate.h:25:36: error: cannot convert 'tools::ApplicationState*' to 'components::IFactoryItem*' in initialization
===
IFactoryItem* result = new Type(); //The problem line


CMake configuration went fine, and it knows where the boost libraries and all its other dependencies are. However, I still had to add -lboost_system-mgw47-mt-1_51 to Tools/EditorFramework/CMakeFiles/EditorFramework.dir/links.txt. CMake had it including the Boost libs directory to search in, but wasnt actually linking the library for that particular build target, which causes problems.

In Tools/EditorFramework/Dialog.h and Tools/EditorFramework/StateController.h, I replaced the #ifndef _86dc80f6_1e36_4664_ace2_4c51c5ee10c4_ -type header guard with #ifndef __DIALOG_H__ -type header guards, to match the duplicate headers header guard and prevent redefinition errors. I'm not clear how these gibberishy header guards are supposed to work, with the duplicate headers. Exporting to a shared library is something of a mystery, with the __declspec( dllexport ) and all that. I also had to add a few absolute filepaths for some headers, again, to make sure it was using the header in Tools/, not Common/Tools/. Otherwise it complained about undefined methods.

Last, I added #include "F:\ProjectMW\DEPS\MyGUI_3.2.0SRC\Tools\LayoutEditor\ApplicationState.h" to FactoryTemplate.h (The one throwing the error at the top). This fixed the error at first, but it popped back up later in the compilation process.

Hopefully someone knows whats going on. I've run out of ideas and I cant really figure the code out, and the internet comes up empty.