Building Musescore with Visual Studio 2022
Hi,
I have been having some trouble getting Musescore to compile on my computer with Visual Studio 2022. I was able to generate a solution file, but I get linker errors when building it.
Many are similar to this:
Error LNK2019 unresolved external symbol WINRT_GetRestrictedErrorInfo referenced in function "public: __cdecl winrt::hresult_error::hresult_error(struct winrt::hresult,struct winrt::take_ownership_from_abi_t)"
I also get the error: "Variable CMAKE_BUILD_TYPE is defined multiple times."
Additionally, set the generator in CMakeSettings.json to "Visual Studio 17 2022" in order to generate the solution.
I am wondering if there are fixes to these errors and if I should even be using Visual Studio 2022 since the instructions are for VS2019. I would prefer it but if I had to use a different version of VS that would be fine.
[Update]: I eventually just installed VS 2019 and followed the directions again, but I am still getting the same linker errors(except for the cmake one). Any help for those would still be appreciated.
Thanks for the help,
Alex
Comments
For the linker errors you need to update to VS to use "Windows 10 SDK (10.0.20348.0) and/or "Windows 11 SDK (10.0.22000.2)"
For VS 2022 see https://github.com/musescore/MuseScore/pull/12086