Trouble building Musescore

• Jun 12, 2018 - 04:56

I'm trying to get Musescore building and running on a Windows 10 box using Visual Studio. I've Been following the instructions on

https://musescore.org/en/handbook/developers-handbook/compilation/compi…

I got up to the Compile the Project step without too much trouble. However, the instructions tell me to edit the CMakeSettings.json file which I cannot find anywhere. Is this supposed to be generated by Cmake? Also, it is not obvious to me how exactly I am supposed to build or clean this project. The build menu has a single instruction saying Run Code Analysis on Solution. The only solutions listed on the Solutions panel in the Team Explorer tab are the freetype.sln - the mscore.sln does not appear. I am also getting an error message in my output window:

1> CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
1> Please set them or make sure they are set and tested correctly in the CMake files:
1> LAME_INCLUDE_DIR
1> used as include directory in directory D:/dev/github.com/MuseScore
1> used as include directory in directory D:/dev/github.com/MuseScore
1> used as include directory in directory D:/dev/github.com/MuseScore
...

I'm not sure why I'm getting this error - I added the files in dependencies.zip to the dependencies directory I created as directed by the instructions, and this directory does include the lame DLL and header files.

I'm trying the Visual Studio build after trying and failing to do it with the MinGW instructions. I'd prefer to use Visual Studio, though, since I'm more familiar with it.

Can anyone help me figure out how to compile the project?


Comments

I've spent some time reading up on git. This is what I've tried after cloning a fresh copy of Musescore; let me know if I'm doing this right:

git remote add af https://github.com/afdeprado/MuseScore.git
git checkout -b vsPort master
git fetch af
git checkout af/271135-VisualStudio2017port

(this might be slightly off - I'm reconstructing this as best I can from my shell history.) Anyhow, I believe I now have Deprado's changes in my new vsPort branch. I closed and reopened Visual Studio and am now getting a new error:

>------ Build started: Project: CMakeLists, Configuration: Debug ------
  Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework
  Copyright (C) Microsoft Corporation. All rights reserved.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\MSBUILD : error MSB1016: Specify the verbosity level.
  Switch: -v

  For switch syntax, type "MSBuild /help"

Build failed.

Also, if I need to merge Deprado's changes into my main branch, how would I do that?

In reply to by blackears

I was able to fix the above error by editing the CMakeSettings.json file to update the buildCommandArgs parameter to:

"buildCommandArgs": "",

Issue is described here:
https://developercommunity.visualstudio.com/content/problem/204617/erro…

So I am now able to start the build process! Unfortunately, I cannot create the final binary because the build ends with 17000+ linker errors:

  Link:
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x86\link.exe /ERRORREPORT:QUEUE /OUT:"D:\dev\github.com\MuseScore\build.debug\manual\Debug\genManual.exe" /INCREMENTAL /NOLOGO C:\Qt\5.9.6\mingw53_32\lib\libQt5Test.a C:\Qt\5.9.6\mingw53_32\lib\libQt5QuickWidgets.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Xml.a C:\Qt\5.9.6\mingw53_32\lib\libQt5XmlPatterns.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Svg.a C:\Qt\5.9.6\mingw53_32\lib\libQt5PrintSupport.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Concurrent.a C:\Qt\5.9.6\mingw53_32\lib\libQt5OpenGL.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Help.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Quick.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Qml.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Network.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Sql.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Widgets.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Gui.a C:\Qt\5.9.6\mingw53_32\lib\libQt5Core.a kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"D:/dev/github.com/MuseScore/build.debug/manual/Debug/genManual.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:/dev/github.com/MuseScore/build.debug/manual/Debug/genManual.lib" /MACHINE:X86 /SAFESEH  /machine:X86 genManual.dir\Debug\genManual.obj
    genManual.dir\Debug\getopt.obj
    genManual.dir\Debug\mocs_compilation.obj
D:\dev\github.com\MuseScore\build.debug\manual\genManual.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl qt_assert(char const *,char const *,int)" (__imp_?qt_assert@@YAXPBD0H@Z) referenced in function "void __cdecl parseClass(class QString const &,class QString const &)" (?parseClass@@YAXABVQString@@0@Z) 
D:\dev\github.com\MuseScore\build.debug\manual\genManual.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QChar::QChar(int)" (__imp_??0QChar@@QAE@H@Z) referenced in function "class QString __cdecl linkClass(class QString const &)" (?linkClass@@YA?AVQString@@ABV1@@Z) 
D:\dev\github.com\MuseScore\build.debug\manual\genManual.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QChar::QChar(struct QLatin1Char)" (__imp_??0QChar@@QAE@UQLatin1Char@@@Z) referenced in function "void __cdecl writeOutput(void)" (?writeOutput@@YAXXZ) 
...

Looking at the list of linked libraries, the dependencies directory don't seem to be in there - however, I double checked and it is definitely present in my file system. There also seems to be an entry for it in the Cmake JSON file.

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