Cannot compile MuseScore on Windows 8.1!

• Apr 24, 2018 - 07:55

Hi all,
I spent some more time on this, without success! this is a follow-up to the e-mail thread on mscore "win32 - excluding jack, pulse, etc.".
I followed instructions at:
https://musescore.org/en/handbook/developers-handbook/compilation/compi…
I've been trying compilation with Qt 5.9.4 and mingw 5.3.0, as well as with Qt 5.9.1 (I found out it includes a WebKit submodule, contrarily to 5.9.4, which MuseScore complains about while compiling via cmake). I also downloaded the Qt-additions.zip and unzipped as per instructions.
I'm trying the compilation way using mingw32-make -f Makefile.mingw release, after having edited build/mingw32.cmake and build/mingw32.mingw.cmake to reflect my Qt position.
I keep getting a dialog showing an error about GenManual.exe during the compilation, and after a very long compilation process (that keeps going unless I click OK on that error dialog, that makes the compilation stop immediately instead), the MuseScore.exe does not get compiled, with a set of errors about either WebKit or WebView or similar Qt subcomponents that don't seem to be installed anywhere on the system.
Any help would be appreciated, thanks!


Comments

Are you trying to compile the code from the master branch or from a 2.x branch? For the latter you need Qt 5.4 (and the mingw 4.9.1, tool chain that goes along with it), for the former build/mingw32.mingw.cmake is gone, so I assume you're trying to build from a 2.x branch.

The need for Qt 5.4 for the 2.x branches is listed in the developers' handbook:
The 2.x branches require Qt 5.4 however, as QtWebKit is needed, and that had been removed in post 5.4 versions of Qt for Windows.

In reply to by Jojo-Schmitz

Hi, I had used master in my previous attempts, but in my latest try I just used the 2.2.1 stable, in the hope it would have been easier. Another reason for trying again stable, is that I've seen a number of people struggling at compiling my modified MuseScore with the PianoTutor, quite a number of which not being familiar with software development, and anyway getting stuck within the MuseScore own compile process itself, so I've made my mind into trying to distribute binaries for Linux and Windows, to simplify the process. Now, as from my limited experience playing with master, it looks quite unstable yet, so my current workflow is to open the stable distribution-provided MuseScore to open MIDIs and scores, cut, paste, select voices, etc..., then switching to master+PianoTutor just for the playing. I assume if I'll backport my patch to the latest stable, it should all be smoother.

Your comment about the Qt <=5.4 vs >5.4 issue and QtWebKit explains the further problems I'm experimenting with 2.2.1, as I'm using Qt5.9.1, albeit I think there's for example the genManual.exe error dialog that seems an unrelated problem.

Now I'm going to try again exactly with the versions reported by Antonio (ABL) and let you know how it goes. Thanks.

Hi Tommaso,
Sorry that I enter the conversation only at this point, but I completely missed the conversation in the mailing list.
If I understood correctly from your messages in the mailing list, you are trying to compile your piano-tutor-win32 branch for Windows. Since this branch is based on master, as Jojo-Schmitz correctly points out, there should not be a build/mingw32.mingw.cmake file anymore (this is present only in 2.x branches).
I locally cloned your git branch and managed to compile it with basically the same script I am using for the usual MuseScore copilation. If it may be of help, I am attaching that script to this post (I renamed it to txt); I use command line compilation (not Qt Creator); I installed MinGW (mingw-w64 32bit) in C:\Mingw and copied the needed headers in the include folder, and the needed dlls in the lib folder, and jack 32bit in Program files (x86) folder. I installed Qt 5.9.3 (but with 5.9.4 it should be the same) in C:\Qt\Qt5.9.3.
[See attached screenshots]
Then I am launching the compilation after properly setting the PATH, as you can see in the script (note that for the "revision" target git should be in the PATH, and in the script I am using msys32 git, but this is not necessary for MuseScore compilation).
My antivirus blocked and crashed once the compilation of the piano-tutor-win32 branch for behavior analysis, but launching the script again after the antivirus had ended completed the compilation.
Here is the result (this is a debug build, as you can see from the commmand used in the script):
https://drive.google.com/open?id=1Y6-Lk105WN1-EUqbDlA6BdG0WxYj_m52

I hope this helps.
Ciao,
ABL

Attachment Size
Capture.PNG 35.75 KB
Capture2.PNG 24.31 KB
Capture3.PNG 24.42 KB
compila_piano_tutor_bat.txt 985 bytes

In reply to by ABL

looks like extremely useful, I'm going to try this script right now and let you know.
I have a few doubts though:
1) do you need a separate installation of Mingw, or the one provided with Qt is just sufficient ?
2) what difference between mingw32-* vs "mingw-w64 32bit" ?
3) unless I'm misunderstanding your script, you just end-up using the mingw32-make coming from the Qt....\mingw53_32\bin, so the C:\Mingw is not actually being used?
Thanks,
Tommaso

In reply to by Tommaso Cucinotta

Hi,
I've just retried back with master and Qt 5.9.1, compiling with Qt...\Tools\mingw530_32\bin\mingw32-make, and I've got the same outcome: genManual.exe error dialog during the compilation process (see first attachment), as well as a built .exe that refuses to run, where I get a second error dialog trying to run the built .exe (see second attachment).
My next try will be again with 2.2.1, but this time with Qt5.4 and mingw491, I'll post here what happens.
In the meantime, I'd appreciate any help as for the problems I'm experimenting with master, and perhaps it may be useful if you could post a pointer to the built win32 executable, at least I'll be able to ascertain whether my win32 patch works, or it has problems.
Thanks!

Attachment Size
Cattura di schermata (1).png 295.21 KB
Cattura di schermata (2).png 227.39 KB

In reply to by Tommaso Cucinotta

I finally managed to compile both the mainline and the 2.2.1 branches :-)!
AFAICR, the trick was:
1) build 2.2.1 against Qt5.4.x, 3.x against Qt5.9.x, and expand the Qt-additions.zip the right way into Qt folders
2) customize Qt paths in build/mingw32*.cmake
3) install stand-alone CMake for Windows
I think the major and obscure issue has been 3). As Qt includes a mingw32-make tool, that happens to be able to build MuseScore into a .exe file, installing the stand-alone CMake seemed to me completely unnecessary ... I was totally mistaken!
Time to test PianoTutor, but I might come back asking some M$-specifics of dealing with a USB/serial device thanks for the help!

In reply to by Tommaso Cucinotta

Got my PianoTutor working on Windows, finally :-)! (based on todays master)

I had to add some further little patch in order to have the new serialDevice widget correctly being used (on the laptop I'm trying, the Arduino serial port comes up as COM3). The current piano-tutor-win32 branch has correspondingly been updated (via git push -f).

At the moment, I'm seeing this assert triggering quite easily when opening a .mid file. Seems unrelated to my changes. Note that I could play, try out the full PianoTutor loop, playback, etc...., all with Jack NOT running!

C:\GitHub\MuseScore>win32install\bin\MuseScore.exe
Cannot connect to named pipe after wait = \.\pipe\server_jack_default_0 err = 2

Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Open error: is JACK server running?
Debug: No device selected. PortAudio detected 9 devices. Will use the default
device (index 2). (C:\GitHub\MuseScore\mscore\pa.cpp:102, virtual bool Ms::Portaudio::init(bool))
Debug: Init midi driver failed (C:\GitHub\MuseScore\mscore\pa.cpp:145, virtual bool Ms::Portaudio::init(bool))
Debug: element -- (C:\GitHub\MuseScore\mscore\events.cpp:321, virtual void Ms::ScoreView::mousePressEvent(QMouseEvent*))

In reply to by Tommaso Cucinotta

EDIT: cross-posting with your comment. Sorry for the noise from my side :-)
I am glad everything worked!

Ciao Tommaso,
1) the installation provided by Qt is enough, provided that the needed dependencies (the *.h of ogg, lame, etc. and the *.dll of libogg, libvorbis, etc.) are copied in the correct places inside it; I use a separate MinGW installation because I use it also for other projects (and as the gcc compiler inside msys32).
2) Qt 5.9.x is embedding mingw-w64 32bit version 5.3, so they are basically the same (well, actually I am using a newer version of MinGW-w64 than the one offered by Qt); MinGW-w64 offers compilers for 32bit and 64bit Windows, but Qt uses the 32bit version.
3) No, you see that I am using C:\Qt\Qt5.9.3\5.9.3\mingw53_32\bin, which contains the binaries of Qt itself (but not the MinGW compiler; the "mingw53_32" name of the folder simply means that it is Qt compiled with MinGW) and C:\MinGW\bin, which contains MinGW 32bit executables (among which mingw32-make.exe). In your case they should be something like C:\Qt\5.9.3\mingw53_32\bin for Qt binaries and C:\Qt\Tools\mingw530_32\bin for MinGW binaries.

I suspect that there could be a problem with the PATH when running genManual.exe (which is generated during compilation): you could try to strip everything from the PATH except the essential folders (Qt bin folder, MinGW bin folder, cmake bin folder, and maybe a couple of Windows system folders) before launching the make command, similarly to what I am doing with my script. Note that msys32 or cygwin could severly interfere with the compilation if they are present in the PATH when running mingw32-make.

I see that you are trying to run MuseScore.exe from the compilation folder: it is better to run the "mingw32-make install" (respectively, installdebug) that copies the executable and all the needed dlls (and other needed additional files) in the MuseScore\win32install folder. MuseScore.exe will then be located in win32install\bin folder.
By the way, it seems that the error you are seeing is a permission error. You could try to temporarily disable the antivirus during compilation, or at least before running MuseScore (mine for example tries to sandbox genManual.exe, and sometimes also subprocesses of mingw32-make, and this sometimes determines a freeze and subsequent crash of the compilation).

In my previous comment I put a link to a compressed folder (the "win32install" folder) I uploaded to my Google Drive, containing the Windows compilation of your branch: you can simply download it and decompress with 7zip. This is almost exactly like Windows Nightly builds are delivered. The executable is inside "bin" subfolder.

Spero tutto ciò ti possa essere di aiuto :-)
Ciao,
ABL

Do you still have an unanswered question? Please log in first to post your question.