Join GitHub today
How to build Gem on Microsoft Windows (MINGW)
How to build Gem on Microsoft Windows using MinGW
This document describes how to build Gem on W32 using MinGW
also make sure you have the following dev package installed
I have used the default installation target, which will install everything to
Since we need the MinGW Shell (which I find installed as
I created a shortcut from my desktop to that batch-file.
MinGW automatically mounts the W32 drives. Therefore my Pd-installation is visible as
I also like to have the Gem-sources available in my MinGW home-directory, so I added the
following line to the
This tells MinGW to make the
Development folder in my W32-home directory available
src folder in my MinGW-home directory.
You need the Pure Data sources to build Gem, either Pd-vanilla or Pd-Extended. The easiest way is to download a zip for Windows from http://puredata.info/downloads. Then unpack it.
I installed Pd-vanilla and unzipped it into
I will use this path in the rest of the tutorial.
Note that you probably should choose a path that does not contain spaces.
is bad, it's better to use
Obviously you will need the Gem sources, to compile it. See the other WIKI pages where to find it.
I put the sources into
Now, whenever I open the MinGW Shell, I can do
to find my Gem-sources (see above, how mapped the W32 directories to MinGW paths).
third party libraries
Gem has a plugin system which adds lot's of functionalities depending on the installed libraries.
You will need to have these libraries installed when building Gem, in order to be able to use them.
For text rendering, the FTGL library is required.
If you don't need text display within Gem, you can skip this part, and add
--without-ftgl to the configure flags.
Then build them (in the MinGW Shell).
The freetype2 build system will tell you (when running configure) that it detected "unix" as your system. While this is not strictly true, just ignore it.
cd ~/src/3rdparty/freetype-2.5.3/ ./configure make install
After installing freetype2, we can build FTGL.
We have to do a few hacks in order to make FTGL recognize the W32-names of the the OpenGL libraries (which are called
libglu32, instead of the
libGLU as found on un*x systems).
I hacked together a replacement for
m4/gl.m4, which you can get here. Get the file and copy it into
ftgl-2.1.3~rc5/m4/, replacing the existing file.
$ cd ~/src/3rdparty/ftgl-2.1.3~rc5/ $ ./autogen.sh $ ./configure --with-gl-lib="-lglu32 -lopengl32" $ make install
Since we will do dynamic linking, we need to put the dll's we just created into a place where W32 will find them. A good start is, the directory where the Gem-binary will live (the root of the Gem sources):
$ cp /usr/local/bin/libfreetype*.dll ~/src/GitHub/Gem/ $ cp /usr/local/bin/libftgl*.dll ~/src/GitHub/Gem/
MinGW allows us to use the autotools.
For the following steps, I will assume that you have changed your working directory to the Gem root folder:
$ cd ~/src/GitHub/Gem/
If you have cloned the git repository, you have to build the building tool yourself:
Next we need to run
configure in order to detect all installed libraries and setup the build chain:
$ ./configure \ --with-pd=/c/programme/pd \ --with-ftgl-CFLAGS="-I/usr/local/include $(freetype-config --cflags)" \ --with-ftgl-LIBS="-L/usr/local/lib -lftgl"
The first option (
configure where to find Pd.
--with-ftgl-... flags tell the build-process how to find and use the font-rendering libraries.
Finally start the build by running:
This will take a while.
If all went well, you should now have a
Gem.dll in your directory, and hopefully a number of Gem-output externals and plugins:
$ ls *.dll Gem.dll gem_filmAVI.dll gem_filmDS.dll gem_imageSGI.dll gem_videoDS.dll gem_videoVFW.dll gemw32window.dll
At time of writing, the
modelOBJ plugin is known to fail the build.
For now, you can ignore this.
In order to complete the built despite this error, use
When trying out the so-created binary within Pd, you might get an error about missing dynamic libraries.
To solve this, locate the given library and copy it next to the
Good starting places are
Some libraries I needed to copy:
enabling more plugins
Enabling plugins needs to happen right before compiling Gem (or the respective plugins).
VLC - grab images using libVLC
Get VLC and install it (I assume it is installed into
As with VLC-2.1.5(rincewind) some hacks are needed to be able to successfully compile the videoVLC plugin:
C:\Programme\VideoLAN\VLC\sdk\lib and do the following:
- remove the
libvlccore.lafiles (or move them away, or rename them)
- copy the
- copy the
Then you can enable VLC-support,
by appending the following variables when calling
$ configure \ # other flags go here... --with-libvlc-CFLAGS="-I/c/Programme/VideoLAN/VLC/sdk/include" \ --with-libvlc-LIBS="-L/c/Programme/VideoLAN/VLC/sdk/lib -lvlc"
Finally copy the files
C:\Programme\VideoLAN\VLC next to Gem.