These are some notes/memo about compiling Pencil on Windows
Last edited: 2007-10-12
Pascal Naidon

To compile Pencil for Windows "out of the box"
1) Install Qt from TrollTech if you haven't done it
   (the installer will propose to install MinGW if you don't have any C++ compiler)
2) From the Start menu (for example), launch the Qt Command Prompt (a kind of DOS Terminal)
4) (Using DOS commands like cd) go to the directory where you saved Pencil source, 
   ie the directory where the file pencil.pro is located.
   Then type "qmake". This should generate a makefile from the pencil.pro file.
5) Then type "make". This should compile Pencil.

====================================================================
Qt on Windows
-> The Qt framework is needed to create the graphical interface of Pencil
Use the installer from Trolltech
www.trolltech.com
I've used Qt 4.2.2

Problems encountered
if the following message appears:
mingw32\bin\ld.exe: cannot find -lqtmaind

You are building in debug mode and haven't built the debug libraries.
-> needs to build qmake with the debug libraries, ie:
--> go to the QT bin folder and execute "qtvars.bat compile_debug"

====================================================================
Ming (Flash/SWF library) on Windows
-> The Ming library enables Pencil to export animation to the Flash/SWF format
www.libming.org
I've used Ming 0.3

This took me some time to work out
As a convenience, I put the compiled library (0.3) for Windows in the libwin32 directory, so you can just use those. If you want to get the latest version and compile Ming yourself, here is how I did it

I roughly followed the instructions from
http://eratosthenes.wordpress.com/tag/ming
The MinGW (GNU compiler for Windows) was already installed during the Qt install.
Compiling ming (Flash/SWF library) requires a UNIX-like environment to execute
 the configure script, which is why one has to install Cygwin.
(MinGW and cygwin were installed separately so they are separate environment :
don't re-install mingw within cygwin. To check that you are running the correct
gcc (=MinGW), launch cygwin and type: gcc -v
it should say "mingw special" and not "cygwin special")

Ming requires the zlib and libpng library.
The point is to find these libraries for MinGW:
http://tjaden.strangesoft.net/loadpng/mingw.html
http://gnuwin32.sourceforge.net/downlinks/libpng.php
http://gnuwin32.sourceforge.net/downlinks/zlib.php
(these libraries may also be present withing cygwin (if you have chosen to
install them) but we won't use those.)

Within cygwin, make sure (in your .bash_profile) that the paths are 
set correctly to work with mingw:
PATH ===> /cygdrive/c/MinGW/bin
(LD_)LIBRARY_PATH ===> /cygdrive/c/MinGW/lib
C_INCLUDE_PATH ====> /cygdrive/c/MinGW/include
CPLUS_INCLUDE_PATH ===> /cygdrive/c/MinGW/include

Then download the ming source from
www.libming.org
and go to the ming directory and type:
autoconf (but I'm not sure it's necessary)
./configure
mingw32-make static

Then I put the libming.a, ming.h, ming_conf.h in the "libwin32" directory inside the
 pencil directory, as well as libpng12.a libpng12.dll.a
 and I added
 lib
 -Llibwin32 -lming -lpng
 in the pencil.pro file, for the INCLUDEPATH and LIBS respectively.
 
That worked (compiled pencil.exe)
Now, a copy of the dynamic library libpng12.dll should be present next to
 pencil.exe in order for pencil to run. This library was installed inside
  c://MinGW/bin
That's it.
