Skip to main content
Cross-Compiling OGRE on Debian        
This does not work yet

Tip_icon.png This information is regarding previous versions of Ogre. (Before the switch to a CMake based build system)

Info See Building Ogre for current version.

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:

Copy to clipboard
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:

Copy to clipboard
./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc make 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
Copy to clipboard
CC = gcc CXX = g++ AR = ar INSTALLDIR = /usr

to

Copy to clipboard
CC = i586-mingw32msvc-gcc CXX = i586-mingw32msvc-g++ AR = i586-mingw32msvc-ar INSTALLDIR = /usr/i586-mingw32msvc
  • Now run
Copy to clipboard
make -f Makefile.cygwin
  • This results in several errors similar to this:
Copy to clipboard
Source/FreeImage.h:221: error: conflicting declaration ‘typedef int* PBITMAPINFO’ /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/wingdi.h:1392: 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