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.7 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.7.4
Qt SDK is available at http://qt.nokia.com/downloads The online installer should work.
I installed it in default location:
C:\QtSDK
and choose a custom install since we don't use the mobile development tools
Here is a screen capture for a suggestion of the need modules

The following has to be added to the %PATH%
C:\QtSDK\Desktop\Qt\4.7.4\mingw\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:\QtSDK\mingw\bin
CMake 2.8
Windows binaries for CMake 2.8.2 : http://www.cmake.org/cmake/resources/software.html
Install and choose to put cmake in your PATH.
Important: The build will not work with CMake 2.8.3 or 2.8.4. You need to specifically download version 2.8.2 (or earlier): http://www.cmake.org/files/v2.8/cmake-2.8.2-win32-x86.exe
Optional Tool : NSIS
NSIS is used to create the install package itself. It's not needed if you just want to develop.
Optional Tool: doxygen
doxygen is used to generate developer documentation from the source files. It is not needed to compile the program, but if you plan to develop the generated documentation can aid understanding the classes and class hierarchies.
Download the native windows doxygen installer from www.doxygen.org
Note: there have been reports that the cygwin doxygen package has issues generating MuseScore developer documentation, and so it is recommended to use the native windows doxygen instead.
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.bat, wrc.bat...). So, the directory where you check out MuseScore has to be in your %PATH%.
While the other environment variable changes go in the windows system settings, you may want to build different source trees with QtCreator, you can add changes to the %PATH% environment variable in the project settings there.
Note: directory names with spaces in them cause the build to fail; so avoid spaces in the name of your check out directory.
Change mscore\cmake\mingw32.mingw.cmake to suit your Qt and mingw install
set (CROSS C:/QtSDK/mingw) set (CROSSQT C:/QtSDK/Desktop/Qt/4.7.4/mingw)
Change Makefile.mingw to suit your mingw install
MINGW_DIR = C:/QtSDK/mingw
%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
- LAME for preliminary support for MP3 (latest trunk revisions only)
I choose to put these dependencies directly in MinGW include path. It's ugly but convenient.
Zlib
- Get zlib from http://www.zlib.net/zlib125-dll.zip
- Copy include/zconf.h and include/zlib.h to mingw/include (C:\QtSDK\mingw\include on my install)
- Copy zlib1.dll to mingw/lib
libVorbis and libOgg
It appears that the latest source also requires libraries for Vorbis and Ogg.
- Get the library files for libVorbis and libOgg from: http://www.xiph.org/downloads/
- Copy the directories: include\vorbis and include\ogg into mingw/include (Copy the entire directory so that you end up with mingw\include\vorbis and mingw\include\ogg)
- Get the libogg-0.dll and libvorbis-0.dll and copy them in mingw/lib
Portaudio
- Get portaudio.dll from a previous MuseScore install (bin directory) and copy to mingw/lib
- Get portaudio.h from the current version at http://www.portaudio.com/download.html and copy to mingw/include. You need to decompress the .tar.gz file using using 7 Zip
JACK
- Download the Windows installer for JACK 1.9.8 from http://jackaudio.org/download
- Install
- Build process assumes you installed in
C:\Program Files\Jackor inC:\Program Files (x86)\Jackon a Windows 64-bit
libsndfile
- Windows binary available, choose Win32 http://www.mega-nerd.com/libsndfile/
- Install and go to the installation directory
- Copy include/sndfile.h into the mingw include directory
- Copy libsndfile-1.dll into the mingw lib directory
LAME
- Download the current source files for LAME: http://lame.sourceforge.net/download.php
- You need to decompress this using 7 Zip, as before
- Create a new folder in the mingw/include directory called "lame"
- Copy include/lame.h into mingw/include/lame
Compilation
Open a command line
Browse to the directory where you checked out musescore
Enter
mingw32-make -f Makefile.mingw release
or
mingw32-make -f Makefile.mingw debug
Note that the two options internally set different flags for the compiler. In debug mode the QT_DEBUG flag is used, so conditional code controlled by #ifdef QT_DEBUG is compiled. In release mode NDEBUG is set. Unless you are building a release, it is suggested that you use the "debug" option, like in the section on the Qt Creator IDE (below).
Be patient ... On my Vista laptop (Intel T7550) it takes more than one hour to build. Build times on Windows can be more than twice as long as build times on Ubuntu (using the same computer). Once the compilation finishes, the MuseScore executable can be found in win32build/mscore/mscore.exe. However, before it will start successfully, you need to copy the DLLs libogg-0.dll, libsndfile-1.dll, libvorbis-0.dll, portaudio.dll, zlib1.dll (which you already placed into mingw/lib during the preparation) into the path of the executable. 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. In this case there is no need to copy DLLs, as they are already copied during the make process.
If you need developer documentation for MuseScore then after compiling, type:
cd win32build mingw32-make doxy
The generated documentation can be viewed by opening win32build/Doc/html/index.html in a browser.
Qt Creator IDE
Qt SDK 4.6 or later comes with a new build of Qt Creator 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
-DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_TOOLCHAIN_FILE=../mscore/cmake/mingw32.mingw.cmake
and I use an output directory qtcreator-build in the musescore src repository (the same where you have mscore, win32build, win32install, etc.). As for the manual build, these five DLLs libogg-0.dll, libsndfile-1.dll, libvorbis-0.dll, portaudio.dll, zlib1.dll need to be placed next to the executable in qtcreator-build/mscore.
To compile the debug build and start debugging go to Debug → Start debugging → Start debugging
You have access to Qt help, completion, and debugging features! (Thanks to Laumai31 for debug guidelines)
| Attachment | Size |
|---|---|
| Qt_install_min.png | 15.77 KB |