I am slowly getting Ogre compiled, one step at a time
I must be the only person who uses mingw+codeblocks or something, because I had to change some things in source to get it going- those things were:
OgrePlatform.h - comment out a section as follows:
Code: Select all
// Disable unicode support on MingW at the moment, poorly supported in stdlibc++
// STLPORT fixes this though so allow if found
// MinGW C++ Toolkit supports unicode and sets the define __MINGW32_TOOLKIT_UNICODE__ in _mingw.h
#if defined( __MINGW32__ ) && !defined(_STLPORT_VERSION)
/*# include<_mingw.h>
# if defined(__MINGW32_TOOLBOX_UNICODE__)
# define OGRE_UNICODE_SUPPORT 1
# else
# define OGRE_UNICODE_SUPPORT 0
# endif
#else*/
# define OGRE_UNICODE_SUPPORT 1
#endif
In one of sinbads forum posts, he seems to have said new versions of mingw have no problems with unicode- commenting out seems to have no ill effects.
OgreWin32Prerequisites.h - add define as following:
Code: Select all
#define WINVER 0x500
#include <windows.h>
The window headers that I have conditionally include some needed defines on "if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0490)", (my WINVER is set to 0x403). It seems to be ok to override WINVER in the manner I have, according to my version of windef.h. Maybe I just have some old windows header files or something ? (I'm on vista by the way)
CMake doesn't seem to find ois in the dependencies folder if it's a dll? I had to compile a static library. Then I had to add -ldinput8 -ldxguid to samplebrowser in link.txt to get that one working.
I keep getting these kinds of errors when compiling the samples:
Linking CXX shared library ..\..\bin\Sample_SkyDome.dll
C:\MinGW\bin\g++.exe -shared -o ..\..\bin\Sample_SkyDome.dll -Wl,--out-implib,..\..\lib\libSample_SkyDome.dll.a -Wl,--major-image-version,0,--minor-image-version,0 CMakeFiles\Sample_SkyDome.dir\src\SkyDome.cpp.obj -LC:\Boost\lib ..\..\lib\libOgreMain.dll.a ..\..\..\Dependencies\lib\release\libOIS.a ..\..\..\Dependencies\lib\release\libzlib.a ..\..\..\Dependencies\lib\release\libzziplib.a ..\..\..\Dependencies\lib\release\libFreeImage.a ..\..\..\Dependencies\lib\release\libfreetype235.a C:\Boost\lib\libboost_thread-mgw44-mt-1_39.lib C:\Boost\lib\libboost_date_time-mgw44-mt-1_39.lib -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.
Error running link command: The system cannot find the file specified
mingw32-make.exe[2]: *** [bin/Sample_SkyDome.dll] Error 2
mingw32-make.exe[1]: *** [Samples/SkyDome/CMakeFiles/Sample_SkyDome.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2
Info: resolving Ogre::Vector3::ZERO by linking to __imp___ZN4Ogre7Vector34ZEROE (auto-import)
Info: resolving Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME by linking to __imp___ZN4Ogre20ResourceGroupManager27DEFAULT_RESOURCE_GROUP_NAMEE (auto-import)
Info: resolving Ogre::Quaternion::IDENTITY by linking to __imp___ZN4Ogre10Quaternion8IDENTITYE (auto-import)
Info: resolving vtable for Ogre::Exception by linking to __imp___ZTVN4Ogre9ExceptionE (auto-import)
Info: resolving Ogre::Math::fDeg2Rad by linking to __imp___ZN4Ogre4Math8fDeg2RadE (auto-import)
Info: resolving Ogre::Vector3::UNIT_Y by linking to __imp___ZN4Ogre7Vector36UNIT_YE (auto-import)
Info: resolving Ogre::StringUtil::BLANK by linking to __imp___ZN4Ogre10StringUtil5BLANKE (auto-import)
Info: resolving Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME by linking to __imp___ZN4Ogre20ResourceGroupManager30AUTODETECT_RESOURCE_GROUP_NAMEE (auto-import)
Info: resolving Ogre::Vector3::UNIT_Z by linking to __imp___ZN4Ogre7Vector36UNIT_ZE (auto-import)
Creating library file: ..\..\lib\libSample_SkyDome.dll.a
Process terminated with status 2 (1 minutes, 7 seconds)
0 errors, 605 warnings
The dlls get created, and they work- but this seems to happen after make checks to find them. Basically I have to compile each individually
I haven't gotten a FreeImage version working yet, I will try that again soon.
Overall, nice work with this