Compile instructions (Windows - MinGW) - SVN trunk

Here is an attempt to make build on windows easier. It should work with the last SVN trunk. It will not work with versions 0.9.4 or older.

Updated for Qt 4.6 and use of Qt Creator IDE with debug feature

What you need

Tools

You need to get the installer for all these tools and install them.

Qt 4.6.2

Qt SDK is available here
http://www.qtsoftware.com/downloads (click on "LGPL / Free Downloads" for the open source edition)
I installed it in default location:

C:\Qt\2010.02

The following has to be added to the %PATH%

C:\Qt\2010.02\qt\bin
MinGw

The MinGW version shipped with Qt is the most suitable since Qt is compiled with it. It's GCC 4.4.0.
You have to add the following to your %PATH%

C:\Qt\2010.02\mingw\bin
Cmake 2.8

Windows binaries for Cmake 2.8.1 : http://www.cmake.org/cmake/resources/software.html
Install and choose to put cmake in your PATH

Optional Tool : NSIS

NSIS is used to create the install package itself. It's not needed if you just want to develop.

Source Code

I use the SVN code and tortoiseSVN. http://tortoisesvn.net/downloads
https://mscore.svn.sourceforge.net/svnroot/mscore/trunk
Some scripts included in the source code are called during the installation (wine.bar, wrc.bat...). So, the directory where you check out musescore has to be in your %PATH%.

Change mscore\cmake\mingw32.mingw.cmake to suit your Qt and mingw install

set (CROSS C:\Qt\2010.02\mingw)
set (CROSSQT C:/Qt/2010.02/qt)

%PATH% summary

You must have cmake/bin, mingw/bin, qt/bin and the directory where you check out musescore in your %PATH%

Dependencies

In addition to Qt, Musescore depends on:

  • zlib for zip handling
  • portaudio to access windows audio...
  • JACK to connect to JACK Server for MIDI and audio (Revision 2162 or later)
  • libsndfile for wav/ogg/flac output
  • Ogg and Vorbis for support of ogg soundfonts

I choose to put these dependencies directly in MinGW include path. It's ugly but convenient.

Zlib
  1. Get zlib from http://www.zlib.net/zlib123-dll.zip
  2. Copy include/zconf.h and include/zlib.h to mingw/include (C:\Qt\2009.05\mingw\include on my install)
  3. Copy zlib1.dll to mingw/lib
libVorbis and libOgg

It appears that the latest source also requires libraries for Vorbis and Ogg.

  1. Get the library files from: http://www.xiph.org/downloads/
  2. Copy the entire directories of include\vorbis and include\ogg directories into mingw/include
  3. Get the libogg-0.dll and libvorbis-0.dll and copy them in mingw/lib
Portaudio
  1. Get portaudio.dll from a previous MuseScore install (bin directory) and copy to mingw/lib
  2. Get portaudio.h from http://www.portaudio.com/download.html and copy to mingw/include
JACK
  1. Download the Windows installer for JACK 1.9.5 from http://jackaudio.org/download
  2. The downloaded files is a .tgz file. You need to decompress this using 7 Zip
  3. The decompressed file expands to a .tar file. You need to decompress again using 7 Zip to create a usable directory of files
  4. Go to jack-1.9.5\bin\windows and click on Jack_v1.9.5_setup.exe
  5. Build process assumes you installed in C:\Program Files\Jack v1.9.5
libsndfile
  1. Windows binary available, choose Win32 http://www.mega-nerd.com/libsndfile/
  2. Install and go to the installation directory
  3. Copy include/sndfile.h in mingw include directory
  4. Copy libsndfile-1.dll in mingw lib directory

Compilation

Open a command line
Browse to the directory where you checked out musescore
Enter

mingw32-make -f Makefile.mingw win32

Be patient ... On my vista laptop (Intel T7550) it takes more than one hour to build. More than twice longer than on Ubuntu on the same laptop. Once the compilation finishes, you should be able to run MuseScore from win32build/mscore/mscore.exe. This should be sufficient for most development work.

If you need the language files, instrument list, templates, and the normal directory structure of a installed version of MuseScore then type:

mingw32-make -f Makefile.mingw install

Once install has finished look in the current directory for win32install/bin/mscore.exe

Qt Creator IDE

Qt sdk 4.6.2 comes together with a new build of Qt supporting CMake.
Once you setup everything above, you can open Qt Creator. Go to File->Open. Choose CmakeLists.txt file type and open the CmakeList in mscore/CMakeList.txt.
For the first Cmake run I input the following arguments

-G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE=../mscore/cmake/mingw32.mingw.cmake -DCMAKE_INSTALL_PREFIX=../win32install -DCMAKE_BUILD_TYPE=Debug ../mscore

and I use an output directory qtcreator-build in the musescore src repository (the same where you have mscore, win32build, win32install etc ...)
Then Debug -> Start debugging
You have access to Qt help, completion, and debug! (Thanks to Laumai31 for debug guidelines)