CMake Errors / Win 10 / VS 2022 #410
-
Hi, I'm trying to get matplot++ compiled in Win 10. I found an older question from 2022, but it is unanswered. I tried to follow your guide on building from source. I did the following:
I directly get the following CMake errors: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_C_COMPILER not set, after EnableLanguage CMAKE_CXX_COMPILER not set, after EnableLanguage (I get the same errors when cloning with external/local git instead of VS 2022's git.) I found the CMakePresets_schema.json, and I guess I have to define my own configurePreset and buildPreset. But I'm completely unfamiliar with CMake. I also tried adding the path of the MS Visual Studio 2022 compiler to the CMakeList.txt, but I guess this will not be sufficient, and I'm not sure what to add ("cl.exe"?). Can you please hint me in any direction? If matplot++ is not supported with Windows (any more), please let me know. Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
You shouldn't set the generator or compilers when using MSVC. |
Beta Was this translation helpful? Give feedback.
-
Hello, I solved it. Might be completely obvious for anyone who's into CMake, but for me it took a while. As expected the problem was in CmakePresets.json. The generator is "Unix makefiles". I had to change this to "Visual Studio 17 2022" and was able to make and compile it. So basically I did:
and
and
and so on. As I don't have write privilege, I cannot push my committ. Please find it attached. Let me know, if this is fine for you. Thanks again, 0001-build-Added-support-for-MS-Visual-Studio-2022-in-CMa.patch |
Beta Was this translation helpful? Give feedback.
-
Yes. That's correct. CMakePresets.cmake should't explicitly set the generator. |
Beta Was this translation helpful? Give feedback.
Hello,
I solved it. Might be completely obvious for anyone who's into CMake, but for me it took a while. As expected the problem was in CmakePresets.json. The generator is "Unix makefiles". I had to change this to "Visual Studio 17 2022" and was able to make and compile it.
So basically I did:
and