Is there any difference when compiling MuseScore in Visual Studio 2019?
Visual Studio 2019 was released not long time ago so I downloaded it. I want to try compiling MuseScore using VS2019 and I wonder if there's anything different than in VS2017? Including the installation settings of VS2019 itself and the pre-requisites?
Comments
I noticed Qt Library hasn't got MSVC2019 installing options yet... will choosing MSVC2017 affect the whole process?
In reply to I noticed Qt Library hasn't… by Howard-C
When on doubt, try it out.
Then report success oder failure here ;-)
Also, I downloaded Jack 64-bit setup wizard but why does it install in
C:\Program Files (x86)\Jack
? The version installed is 1.9.11.In reply to Also, I downloaded Jack 64… by Howard-C
Ask the Jack folks. I found this quite strange too...
"The file dependencies.7z contains all the required dependencies, and is easier to use. Download, and extract the contents into the base dir. (This will create a new dependencies folder in that base dir.)"
-- Additional Dependencies in the guide
What is the "base dir"? The base directory of the MuseScore project?
In reply to The file dependencies.7z… by Howard-C
Yes
"Add
C:\Qt\5.12.3\msvc2017_64\bin
to your PATH variable (C:\Qt\5.12.3\msvc2017\bin
for 32-bit)CMake "can't find resource" failures are probably because the Qt path is not set properly in PATH.
Make sure you removed mingw's
C:\Qt\5.*\mingw*\bin
entrance from the PATH if any"What is PATH?
In reply to "Add C:\Qt\5.12.3\msvc2017… by Howard-C
The search path for executables, a semicolon (in Windows, Linux and Mac use colon here) separated list of directories
In reply to The search path for… by Jojo-Schmitz
So how can I add the thing to the PATH?
In reply to So how can I add the thing… by Howard-C
Control Center > System & Security > System > System Properties > Advanced > Environment, there either the PATH for the user or the System.
Or on the command line
set PATH=C:\Qt\5.12.3\msvc2017_64\bin;%PATH%
In reply to Control Center > System &… by Jojo-Schmitz
Sorry if I'm too dumb, but "Control Center"? I only know "Control Panel" and "Settings" (in Win 10) and neither of them have "System Properties". Did you mean the system's "Control Center"? Where is it? XD
In reply to Sorry if I'm too dumb, but … by Howard-C
Sorry I meant Control Panel, and I'm using Windows 7, mainly.
On Windows 10 is it Control Panel > System and Security > System > Advanced System Settings > Advcanced > Environment Variables...
In reply to Sorry I meant Control Panel,… by Jojo-Schmitz
I opened "Environment Variables" and clicked "New", so I just enter "PATH" for the variable name and the directory route for the variable value?
In reply to I opened "Environment… by Howard-C
not new, "Path" should be existing already, and you just add an additional entry to it
In reply to not new, they should be… by Jojo-Schmitz
I see, thanks!
What's wrong with it...
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe -G "Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX:PATH="C:\E盘\MuseScore-master\msvc.install_x64" -DCMAKE_BUILD_TYPE:STRING="RELWITHDEBINFO" -DBUILD_FOR_WINSTORE:STRING="OFF" -DBUILD_64:STRING="ON" -DCMAKE_PREFIX_PATH:STRING="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/bin/Roslyn;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Team Tools/Performance Tools/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Team Tools/Performance Tools;C:/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019//x64;C:/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019/;C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x64;C:/Program Files (x86)/Windows Kits/10/bin/x64;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community//MSBuild/Current/Bin;C:/Windows/Microsoft.NET/Framework64/v4.0.30319;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/Tools/;C:/Program Files (x86)/Intel/iCLS Client/;C:/Program Files/Intel/iCLS Client/;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;C:/WINDOWS/System32/WindowsPowerShell/v1.0/;C:/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL;C:/Program Files/Intel/Intel(R) Management Engine Components/DAL;C:/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT;C:/Program Files/Intel/Intel(R) Management Engine Components/IPT;C:/WINDOWS/System32/OpenSSH/;C:/CTEX/UserData/miktex/bin;C:/CTEX/MiKTeX/miktex/bin;C:/CTEX/CTeX/ctex/bin;C:/CTEX/CTeX/cct/bin;C:/CTEX/CTeX/ty/bin;C:/CTEX/Ghostscript/gs9.05/bin;C:/CTEX/GSview/gsview;C:/CTEX/WinEdt;C:/Program Files/Git/cmd;C:/Users/svetz/AppData/Local/Microsoft/WindowsApps;;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin;C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja;C:/E盘/MuseScore-master/dependencies" -DCMAKE_LIBRARY_PATH:STRING="C:/E盘/MuseScore-master/dependencies/libx64" -Wno-deprecated -DCMAKE_CONFIGURATION_TYPES="RelWithDebInfo" "C:\E盘\MuseScore-master" returned with exit code: 1
In reply to C:\PROGRAM FILES (X86)… by Howard-C
No idea, maybe it doesn't like that 盘 ?
In reply to No idea, maybe it doesn't… by Jojo-Schmitz
I laughed for literally a minute after seeing your reply XDD
But no, after I moved the MuseScore folder to
C:\MuseScore-master
the problem still occurred. I'm afraid the problem is as below:1> [CMake] CMake Error at C:\MuseScore-master\CMakeLists.txt:20 (project):
1> [CMake] Generator
1> [CMake]
1> [CMake] Visual Studio 15 2017
1> [CMake]
1> [CMake] could not find any instance of Visual Studio.
Seems like the current version cannot accept Visual Studio 2019?
In reply to I laughed for literally a… by Howard-C
Ah:
_C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe -G "Visual Studio 15 2017" _
That of course needs to be:
_C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe -G "Visual Studio 16 2019" _
In reply to Ah: _C:\PROGRAM FILES (X86)… by Jojo-Schmitz
So where should I make changes? The output comes out automatically.
In reply to So where should I make… by Howard-C
I guess in msvc_build.bat?
SET GENERATOR_NAME="Visual Studio 15 2017"
In reply to I guess in msvc_build.bat? by Jojo-Schmitz
.bat files cannot be opened, not by non-developers, I guess?
In reply to .bat files cannot be opened,… by Howard-C
What? They are plain text files
In reply to What? They are plain text… by Jojo-Schmitz
You probably shouldn't make changes to it part of any commit you want to get merged though
In reply to What? They are plain text… by Jojo-Schmitz
Double-click on it triggers something like command line and it closes instantly. And I looked into the properties and it doesn't even give me a chance to choose how to open?
In reply to Double-click on it triggers… by Howard-C
Who said something about double-clicking it?
Right-click > Edit
And to execute it, you need to feed it arguments, else nothing happens
Check the developers' handbook on this please.
In reply to Who said something about… by Jojo-Schmitz
Changed all 15 to 16 and all 2017 to 2019, but the error still occurred. The CMake error is at
C:\MuseScore-master\CMakeLists.txt:20 (project)
, but I can't find anything related to VS version in theCMakeLists.txt
...In reply to Changed all 15 to 16 and all… by Howard-C
CMakeSettings.json needs that change too
OK, so CMake and build were all successful (at least Visual Studio told me so), but when I hit Local Windows Debugger the program said three dlls missing:
portaudio.dll
,libsndfile-1.dll
andlibvorbisfile.dll
. So where's wrong?In reply to OK, so CMake and build were… by Howard-C
You may have missed the INSTALL step? And/or the fact that you should start MuseScore 3.exe from msvc.install_x64 direcory, not the msvc.build_x64 one?
In reply to You may have missed the… by Jojo-Schmitz
Thanks, now it's a complete success. I indeed missed the INSTALL step because I was looking at Compile the project at the bottom of the instructions, and there it doesn't mention the INSTALL step. Actually
Execute (or at least, try to execute) MuseScore by clicking on “Local Windows Debugger” on the main toolbar of Visual Studio (or, alternatively, right-click on the mscore project, and select “Debug” -> “Start new instance”).
mentioned in it doesn't work either, MuseScore will only start when opened from msvc.install_x64 > bin. I don't know if this is only not working in VS2019, or that it doesn't work in VS2017 and the instruction is outdated? (Or there are simply mistakes in my operation?)
EDIT: OK, I think maybe it's my fault, let the screenshot explain this -- the last sentence is "access denied".
In reply to Thanks, now it's a complete… by Howard-C
I missed the same step the first time in VS 2017.
In reply to Thanks, now it's a complete… by Howard-C
It is documented in the deveopers' handbook, and I don't see why it would be different between VS 2017 and 219
In reply to Thanks, now it's a complete… by Howard-C
??? Please read the developers handbook. Then in VS, in the Project Exploer right-click INSTALL > Build
In reply to ??? Please read the… by Jojo-Schmitz
I think when you're reading it the first time I feels like you already did that and you don't realize it says do the same thing on a different file. That's the best I can come up with.
In reply to ??? Please read the… by Jojo-Schmitz
BTW: I've just started with a VS 2019 page, basically a plain copy of the one for VS 2017, plus one adde line reg. the changes needed for msvs_build.bat and CMakeSettings.json, see https://musescore.org/en/node/290899
In reply to BTW: I've just started with… by Jojo-Schmitz
Qt has also updated to 5.12.4 on 14th June ;-)
And could you explain the access denied thing above?
In reply to Qt has also updated to 5.12… by Howard-C
Updated to 5.12.4...
it is not access denied, but no such file I would guess? But I can't recipher those Chinese (?) characters
In reply to Updated to 5.12.4... it is… by Jojo-Schmitz
Seems like there are just a few things and no executable files in that folder... I wonder why VS intended to start the program from there.
And all program files are in msvc.install_x64, so what are those files in RelWithDebInfo > INSTALL serve for?
Seems like VS2019 doesn't recognize this anymore:
"buildCommandArgs": "-v"
In reply to Seems like VS2019 doesn't… by Howard-C
I am trying right now to build, and since 2019 is the default I am following this post, but did anyone (especially @Howard-C) succeed?
Or should I revert to 2017. If so, which one should I use? There is quite a few 2017 possibilities...
In reply to I am trying right now to… by ecstrema
Of course I succeeded, otherwise how can I make code contributions ;-)
You can use VS2019, but then you have to modify two files as documented in the instruction manual to get CMake working properly.
In reply to Of course I succeeded,… by Howard-C
Would you mind sharing with me your two files? I've tried to modify them accordingly but now I get this error:
The files I modified:
Would you mind posting here your
- CMakeSettings.json
- msvc_build.bat
- mybuild.bat (if you use it as here)
In reply to Would you mind sharing with… by ecstrema
"Win64" should be kept if there is one.
In reply to "Win64" should be kept if… by Howard-C
when keeping it:
In reply to when keeping it: [inline… by ecstrema
Maybe
SET GENERATOR_NAME="Visual Studio 16 2019 -A Win64"
?Is that maybe a recent change in VS 2019 or in CMake?
In reply to Maybe SET GENERATOR_NAME=… by Jojo-Schmitz
Also tried:
In reply to Also tried: [inline:issue… by ecstrema
@Howard-C would you mind sending me those files, so I can check what you did?
In reply to @Howard-C would you mind… by ecstrema
Not a good time for me. But my edition was basically the same with your first screenshot, except that I kept the "Win64"s.
In reply to Not a good time for me. But… by Howard-C
doesn't work for me. Apparently, 2019 version can't have the architecture in the name, it must be specified as argument. (As shown above)
In reply to doesn't work for me… by ecstrema
Have you updated VS recently? If so, did you restart your computer specifically from the VS installer after updating, if it told you to do so?
In reply to Did you update VS recently?… by Howard-C
Unfortunately yes, I did restart it a few times...
In reply to Maybe SET GENERATOR_NAME=… by Jojo-Schmitz
Probably not, I updated to the latest version of VS yesterday, and the whole building process is the same, including CMake.
In reply to Probably not, I updated to… by Howard-C
Good to know that it's just me that is stupid :)
Are you using Windows 10 x64?
In reply to Good to know that it's just… by ecstrema
Yes, Windows 10 x64.
Don't know what did you mean for the first sentence though.
In reply to Yes, Windows 10 x64. Don't… by Howard-C
Haha, it only means its my fault and not my computer's...
And that's good news... but also bad news :"|
In reply to Haha, it only means its my… by ecstrema
I believe VS exposes itself to CMake only with the architecture included if you have different architecture targets installed of the VS toolchain.
So if you only installed the x86 or x64 toolchain, then you indeed shouldn't have a suffix for it.
(other than that, I haven't tried building with MSVC recently and still have 2017 here; so unfortunately can't offer any further insight into what would be failing on your end)