Cross-Compiling OGRE on Debian         This does not work yet

This does not work yet. Maybe someone can use it as a starting point.
For a guide on how to compile your application using a precompiled OGRE SDK see Cross Compiling in Linux.

First, install the MinGW package:

apt-get install mingw32

Now you have two options for obtaining the dependency libraries: either get pre-built ones from the homepage, or build them from source.

Building dependencies yourself

Useful information can be found on this page: Build OGRE dependencies using MSYS.

First, get dependency library sources:

For each library, run:

./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc
 make install (as root)

Because of non-standard configure scripts this does not work for jpeg and reportedly not for zlib, so let's try FreeImage instead:

  • Download and extract FreeImage
  • Edit Makefile.cygwin
  • Change
CC = gcc
 CXX = g++
 AR = ar


CC = i586-mingw32msvc-gcc
 CXX = i586-mingw32msvc-g++
 AR = i586-mingw32msvc-ar
 INSTALLDIR = /usr/i586-mingw32msvc
  • Now run
make -f Makefile.cygwin
  • This results in several errors similar to this:
Source/FreeImage.h:221: error: conflicting declaration ‘typedef int* PBITMAPINFO’
 error: ‘PBITMAPINFO’ has a previous declaration as ‘typedef struct tagBITMAPINFO* PBITMAPINFO’

Download pre-built dependencies

  • Visit this page and download "Code::Blocks + MingW C++ Toolkit Precompiled Dependencies 1.4.x"
  • Move everything from "Dependencies/include" to "/usr/i586-mingw32msvc/include/"
  • Move everything from "Dependencies/lib/Release/" to "/usr/i586-mingw32msvc/lib"
  • Rename libFreeImage.a to libfreeimage.a
  • Move everything from "Samples/Common/bin/Release" to "/usr/i586-mingw32msvc/lib"
  • rename cg.dll to Cg.dll

Configure fails here because FreeImage_Load cannot be found in libfreeimage.a.

Build OGRE

Get the OGRE sources and run
./configure prefix=/usr/i586-mingw32msvc/ host=i586-mingw32msvc --with-platform=Win32