Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Compile MuPDF in Windows with MSYS MinGW

alirezajafari edited this page Oct 8, 2015 · 8 revisions

Installing MSYS/MinGW

Install MSYS and MinGW (http://www.mingw.org/wiki/Getting_Started). Using the Graphical User Interface Installer, mingw-get-setup.exe, is recommended. During installation, "checking/ticking" the following in "Basic Setup" is recommended:

  1. mingw32-base
  2. mingw32-gcc-g++
  3. msys-base
  4. mingw-developer-toolkit

Add C:\MinGW\bin;C:\MinGW\msys\1.0\bin; to your PATH system variables (at the beginning).

Download MuPDF Source

Download the source(such as mupdf-1.4-source.tar.gz) from http://mupdf.com/downloads/. Then extract it.

Building MuPDF

Open MinGW Shell (C:\MinGW\msys\1.0\msys.bat) then cd to MuPDF source directory

 `cd path/to/mupdf/source`

execute make

 `make build=debug NOX11=yes`

For release, just change "debug" to "release". NOX11 is necessary since X11 headers are not available in Windows. Note that this will not build the "app" packaged with the MuPDF source.

That's it!

The ".a" binaries are available inside the "build" folder.

  1. libfitz.a
  2. libfreetype.a
  3. libjbig2dec.a
  4. libjpeg.a
  5. libopenjpeg.a
  6. libz.a