본문 바로가기

C++/Build, Make

CMake에서 VS 솔루션 생성 시 'could not find any instance of Visual Studio' 오류

이 문서의 내용

    테스트 환경 및 주요 아젠다

    더보기

    이 프로젝트의 개발 환경

    • 개발 언어 및 주요 환경
      • CMake 3.29.0-rc1
      • Visual Studio Code 1.86.2

    CMake에서 VS 솔루션을 생성하는 과정에서 could not find any instance of Visual Studio 오류가 발생합니다.

    CMake Deprecation Warning at CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
      Compatibility with CMake < 3.5 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    Detected version: 1.2.0
    CMake Error at CMakeLists.txt:17 (PROJECT):
      Generator
    
        Visual Studio 17 2022
    
      could not find any instance of Visual Studio.
    
    
    
    Configuring incomplete, errors occurred!

    문제 해결: Visual Studio 2017 또는 생성 솔루션과 상응하는 IDE 설치

    CMake에서 Configure | Specify the generator for this project 항목이 지원하는 IDE를 설치합니다.

    CMake는 COM(Component Object Model) 인터페이스를 통해 VS를 쿼리하고 VS의 인스턴스 위치를 요청합니다.

    따라서 특정 버전의 IDE를 통한 VS 솔루션을 생성하려면 호환되는 IDE가 PC에 설치되어 있어야합니다. IDE를 먼저 설치하고 솔루션을 다시 생성합니다.

    CMake Deprecation Warning at CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
      Compatibility with CMake < 3.5 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    Detected version: 1.2.0
    Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
    The C compiler identification is MSVC 19.39.33519.0
    Detecting C compiler ABI info
    Detecting C compiler ABI info - done
    Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
    Detecting C compile features
    Detecting C compile features - done
    Configuring done (7.8s)
    더보기

    여전히 CMake가 VS를 쿼리하지 못하면 컴퓨터를 재부팅하고 다시 VS 솔루션을 생성합니다.

    'C++ > Build, Make' 카테고리의 다른 글

    Windows 10에서 CMake 설치하기  (0) 2024.02.18