MuseScore Compile instructions (Windows - MinGW)

 
Compile instructions (Windows - MinGW) - Git
#写在前面:最好是按照步骤来,不要想着自己折腾。
MinGW 4.9.1 and Qt 5.4
Download the Qt Online Installer for Windows.  #这个地反,不知道怎么回事,自己没有在线安装就是配置不对。最后只能选择在线安装。

NB There a number of Windows installers on this page - make sure it is the Online Installer you are downloading. MuseScore is known to work with 5.4.

Run the installer and install Qt in C:\Qt. You just need the Qt libraries for MinGW 4.9.1 and the MinGW 4.9.1 toolchain.

(optional) Add the following to your %PATH%

C:\Qt\Tools\mingw491_32\bin;C:\Qt\Tools\mingw491_32\lib
C:\Qt\5.4\mingw491_32\bin
C:\Qt\Tools\QtCreator\bin
CMake

Download the latest version of windows binaries for CMake. Choose the Windows (Win32 Installer) version. You need at least version 2.8.7. Versions up to 3.3.0 are known to work too. #建议用3.3.0

Install in the default location (probably C:\Program Files\CMake or C:\Program Files (x86)\CMake) and optionally put the bin subdirectory in your PATH.

Optional Tool: NSIS unicode #不用关心

NSIS unicode 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

Get the source code from GitHub. If you need a Git client, you can try Git for Windows or the GitHub windows client.
git clone git://github.com/musescore/MuseScore.git #会用git的话,知道怎么弄,不懂Git的话,去学。推荐廖雪峰老师的git教程

If you plan to contribute to MuseScore, you can setup your own fork on GitHub and clone it instead. See the Git Workflow page.

Note: Directory names with spaces in them cause the build to fail; so avoid spaces in the name of your clone directory.

(optional but recommended) In your clone directory, copy the file build/git/hooks/post-checkout to the directory .git/hooks in order for mscore/revision.h to be maintained automatically by git. See build/git/hooks/README for details. Note that the .git directory is hidden.

Change default paths (optional) #不用关心

The following two steps should not be necessary if using the default paths given above for Qt and MinGW.
Change build\mingw32.mingw.cmake to suit your Qt and mingw install

set (CROSS C:/Qt/Tools/mingw491_32)
set (CROSSQT C:/Qt/5.4/mingw491_32)

%PATH% summary

You must have the following in your %PATH%:

  • C:\Program Files\CMake\bin (or wherever you installed CMake)
  • C:\Qt\Tools\mingw491_32\bin;C:\Qt\Tools\mingw491_32\lib (or wherever MinGW is installed for you)
  • C:\Qt\5.4\mingw491_32\bin (or wherever Qt is installed for you)
  • And if you want to launch QtCreator from the command line C:\Qt\Tools\QtCreator\bin

NOTE: You can add path elements to cmd shells via Computer / System Properties / Advanced System Settings / Environment Variables. However, the make process can be sensitive to the rest of the contents of your %PATH% as well. If you encounter issues like mingw32-make immediately terminating with error code 0xc00000fd, then try stripping your path down to only the above elements, plus perhaps C:\Windows and C:\Windows\System32. You might consider running the build from a batch file that temporarily sets your %PATH% to just the required elements.

A good approach to doing so is to create the following batch file in the "C:\Qt" folder:

C:\Qt\qt.bat

@echo off
echo Setting up a MinGW/Qt only environment...
echo -- Set QTDIR to C:\Qt\5.4\mingw491_32
set QTDIR=C:\Qt\5.4\mingw491_32
echo -- Set PATH to %QTDIR%\bin
set PATH=%QTDIR%\bin
echo -- Adding C:\Program Files (x86)\CMake\bin
set PATH=%PATH%;C:\Program Files (x86)\CMake\bin
echo -- Adding C:\Qt\Tools\mingw491_32\bin;C:\Qt\Tools\mingw491_32\lib to PATH
set PATH=%PATH%;C:\Qt\Tools\mingw491_32\bin;C:\Qt\Tools\mingw491_32\lib
echo -- Adding to C:\Qt\Tools\QtCreator\bin
set PATH=%PATH%;C:\Qt\Tools\QtCreator\bin
echo -- Adding %SystemRoot%\System32 to PATH
set PATH=%PATH%;%SystemRoot%\System32
echo -- QMAKESPEC set to win32-g++
set QMAKESPEC=win32-g++
cd %USERPROFILE%
echo -- Set MAKEFLAGS to -j %NUMBER_OF_PRCESSORS%
set MAKEFLAGS=-j %NUMBER_OF_PROCESSORS%
rem un-rem the following line to start Qt Creator immediately
rem using /low makes sure you can still work with the PC
rem -lastsession gets you back where you left
rem start /low qtcreator -lastsession
Then create a shortcut to this batch file somewhere in the Programs menu. If starting QtCreator immediately, the shortcut can be set to "Start minimized".

Dependencies  #后面给的有压缩包和怎么放。

In addition to Qt, MuseScore depends on:

  • portaudio to access Windows audio
  • JACK to connect to JACK Server for MIDI and audio
  • libsndfile for wav/ogg/flac output
  • Ogg and Vorbis for support of ogg soundfonts
  • LAME for support for MP3 (only the header files)

I choose to put most of these dependencies directly in the MinGW include path. It's ugly but convenient. Either follow the below instructions or install just Jack and Freetype and for the rest take Qt-additions.zip and unpack it into C:\.

libVorbis, libVorbisFile, libOgg

The latest source also requires libraries for Vorbis and Ogg.

  1. Get the library files for libVorbis and libOgg from: http://www.xiph.org/downloads
  2. Copy the directories: include\vorbis and include\ogg into C:\Qt\Tools\mingw491_32\i686-w64-mingw32\include (Copy the entire directory so that you end up with C:\Qt\Tools\mingw491_32\i686-w64-mingw32\include\vorbis and C:\Qt\Tools\mingw491_32\i686-w64-mingw32\include\ogg)
  3. Get the Vorbis Tools and copy libogg.dll, libvorbis.dll and libvorbisfile.dll in C:\Qt\Tools\mingw491_32\lib (You need to decompress the .7z file using 7 Zip)
Portaudio
  1. Get portaudio.dll from a previous MuseScore install (bin directory) and copy to C:\Qt\Tools\mingw491_32\lib
  2. Get portaudio.h from the current version at http://www.portaudio.com/download.html and copy to C:\Qt\Tools\mingw491_32\i686-w64-mingw32\include. You need to decompress the .tar.gz file using 7 Zip, as before.
JACK #这一个是最麻烦的,一直下不下来,也许是我网络的问题,最好好麻烦的下下来了。
  1. Download the Windows installer for JACK from http://jackaudio.org/downloads
  2. Install
  3. The build process assumes you installed in a directory Jack in your program files directory. The name of the program files directory can vary depending on the version and language of Windows. The environment variable %ProgramFiles% or %ProgramFiles(x86)% is used to find the directory. On an English version of Windows this will result in looking in C:\Program Files\Jack or in C:\Program Files (x86)\Jack on a Windows 64-bit
libsndfile
  1. Windows binary available, choose Win32 http://www.mega-nerd.com/libsndfile
  2. Install and go to the installation directory. The installation process is required to be run in administration mode.
  3. Copy include\sndfile.h into C:\Qt\Tools\mingw491_32\i686-w64-mingw32\include
  4. Copy bin/libsndfile-1.dll into C:\Qt\Tools\mingw491_32\lib
LAME
  1. Download the current source files for LAME: http://lame.sourceforge.net/download.php
  2. You need to decompress the .tar.gz file using 7 Zip, as before
  3. Create a new folder in the C:\Qt\Tools\mingw491_32\i686-w64-mingw32\include directory called lame
  4. Copy include\lame.h into C:\Qt\Tools\mingw491_32\i686-w64-mingw32\include\lame
Compilation #不用关心

If you wish to use the QtCreator IDE, follow the instructions in section "Qt Creator IDE", below.

Open a command line, possibly using a batch file such as qt.bat given above.
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 build.release/mscore/MuseScore.exe or build.debug/mscore/MuseScore.exe. So long as C:\Qt\Tools\mingw48_32\lib is in the PATH, it should not be necessary to copy any DLLs. However, it has been found necessary to copy the complete directories iconengines and imageformats from %QTDIR%\plugins to the build.release/mscore or build.debug/mscore directory (resulting in, for example, build.debug/mscore/iconengines. This should be sufficient for most development work.

Note: You may need to go into the preferences, and fix the paths to have Windows-style slash characters (backslash), or you may see error messages about not being able to open files. [Is this a bug?]

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

or, for a debug build:

mingw32-make -f Makefile.mingw installdebug

Once install has finished look in the current directory for win32install/bin/MuseScore.exe. In this case there is no need to copy DLLs or the plugins directories, as they are already copied during the make process.

If you need developer documentation for MuseScore then after compiling, type:

cd build.release
mingw32-make doxy

The generated documentation can be viewed by opening win32build/Doc/html/index.html in a browser.

Qt Creator IDE #这个是重点,因为我用的就是这个IDE

Once you setup everything above, you can open Qt Creator, either by typing start qtcreator from within a command prompt started as above, or by creating a separate batch file with start qtcreator as the last command.

Go to File => Open File or Project....

Choose CmakeLists.txt file type and open the file CmakeLists.txt from your source directory.

Now it will take you through a pathwizard:

  1. Build Location:
    For the first Cmake run, it will offer a build directory such as MuseScore-build, if MuseScore is your checkout directory. Change this to choose a build directory of MuseScore/build.qtc instead.
    Please make sure the name of your build directory does not contain spaces.
  2. Choose CMake Executable:
    Browse to where you installed CMake (i.e. C:\Program Files (x86)\CMake\bin)
  3. Run CMake:
    Then input the following arguments for CMake:

    -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_TOOLCHAIN_FILE=build/mingw32.mingw.cmake -DCMAKE_INSTALL_PREFIX=../win32install

Result:
As for the manual build, the supplementary DLLs should be found via C:\Qt\Tools\mingw491_32\lib in the PATH, so no further setting of environment variables should be required.[ignore]
Before your first build or debug session, you will need to configure the Build, Deploy, and Run steps. Click Projects at left, then Build toward the top of the screen. Under Build Steps, expand the Details button and add a checkmark next to the lrelease target.
Then go back to the top of the screen and click Run. On this screen, you will first need to click Add Deploy Step. Select Make, then select install under Targets.
 
Finally, you will need to click the Add button under Run Configuration to add a custom executable, and set it to %{sourceDir}\win32install\bin\MuseScore.exe.
ERROR

To compile the debug build and start debugging go to Debug => Start debugging => Start debugging or simply click the debug icon. You have access to Qt help, completion, and debugging features!

MuseScore 的编译相关推荐

  1. musescore windows 上面编译

    musescore windows 上面编译: github 地址: https://github.com/musescore/MuseScore.git 我这边下载的是MuseScore-3.6.2 ...

  2. 记一次,编译MuseScore的经历

    MuseScore是一款开源的乐谱编辑软件,很是好用,界面美观.自己在尝试在windows平台编译这个软件过程中,遇到的问题记录如下: 1.MuseScore选的是2.1版本的源码,qt 5.4 +  ...

  3. musescore 4.0编译

    musescore 4.0 的模块化设计 明显 每一个文件下面大部份会形成一个.a的库 在这里插入图片描述 appsehll 模块 appsehll 看得出来是 appsehll 负责加载下面全部子模 ...

  4. MuseScore编译成 移动端的app 02

    musecore 依赖 压缩库 zlib 移植 android 进入根目录 ./configure --prefix=/home/junjun/ --static –prefix=/home/junj ...

  5. MuseScore编译成 移动端的app 01

    musecore 主要用qt 开发 系统架构图 音频系统图 qt 有ios 和android 两个移动端的移植能力 第一步肯定是解决构建的影响 先在pc 上面的系统上构建 window 上面最多外加一 ...

  6. musescore 构建入门

    musescore : 1.QT上面开发 2. Qt由于版本更新, 更新到QT6了, 构建器由qmake 更换到cmake ,musescore 在QT是用cmake 构建桌面软件包, 3.底层依赖库 ...

  7. go build 编译报错 missing go.sum entry for module providing package

    go build 编译报错 missing go.sum entry for module providing package 解决方法 // 移除未使用的依赖 go mod tidy 再次编译,就可 ...

  8. kotlin重写构造方法编译报错:Primary constructor call expected

    在kotlin中使用construct关键字定义构造方法,如果类定义时已经有构造方法(类名后带括号),需要添加构造方法时,需要使用以下写法: class User(var name,var age){ ...

  9. Myeclipse中项目没有代码错误提示,jsp页面无编译迹象?如何解决

    在使用Myeclipse开发项目时,发现jsp页面中嵌入的java代码没有编译的迹象,错误的get方法没有报错,没有报错信息我们如何知道我们开发的内容是正确的呢? 接下来就演示一下如何解决

最新文章

  1. 初创公司MongoDB最佳实践策略和躲坑秘笈
  2. 推荐算法炼丹笔记:阿里序列化推荐算法ComiRec
  3. 实现微信朋友圈动态列表
  4. fastJson null字符串转空 null数字转0
  5. SpringMVC入门(一)之HelloWorld(IDEA版)
  6. git代码库迁移保留commit历史_svn 迁移到 git 仓库并保留 commit 历史记录
  7. [Java] 蓝桥杯ALGO-39 算法训练 数组排序去重
  8. Effective_STL 学习笔记(二)小心对 “容器无关代码” 的幻想
  9. HTML之文本相关标签
  10. 间接寻址级别不同_「计算机组成原理」:常见的指令寻址方式
  11. 数据协作如何解决大数据的大问题
  12. 浅谈WebService的版本兼容性设计
  13. linux信号灯超时时间已到,急!!信号灯超时时间已到错误又出来了!!!!
  14. TCP/IP协议学习总结
  15. 一文将 DCDC 的 Layout 讲的明明白白,收藏这篇就够了
  16. 专升本英语作文信件类必背范文十篇
  17. iOS开发-plist文件的常用操作
  18. 单一窗口关区备案_【亚东关务】单一窗口集中申报来了,集报备案、集报清单详细操作手册...
  19. 系统架构——掌握和使用UML包图模型
  20. 硬件工程师综合训练 旋转图形设计

热门文章

  1. AudioTrack: releaseBuffer() track 0xe5c6bc00 disabled due to previous underrun, restarting
  2. 5大自动化测试的 Python 框架
  3. C++字节对齐(地址对齐)
  4. 开启学习高效率模式——iPhone专注模式怎么设置
  5. python 代理ip
  6. office2010安装出错怎么办
  7. sql 按姓氏笔画(拼音)排序
  8. oracle 算列总数,Oracle认证:Oracle统计符合条件列总数
  9. oracle linux unbreakable linux 6.1迅雷离线高速下载
  10. 你招聘设计师时都问哪些问题?你是怎么招聘设计师大牛的?