"CMAKE_CXX_COMPILER 찾을 수 없음"이 나타나는 이유와 해결 방법은 무엇입니까?

"CMAKE_CXX_COMPILER 찾을 수 없음"이 나타나는 이유와 해결 방법은 무엇입니까?

방금 설치했는데 cmake컴파일러를 찾을 수 없다는 오류가 발생했습니다.

만들려고 하다가https://gitlab.com/interception/linux/tools새로운 쿠분투 설치에서 디렉토리 cmake ..에서 실행하면 오류가 반환됩니다:tools/build

CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

뭐가 문제 야? 컴파일러가 함께 제공될 것이라고 생각했는데 cmake, 이를 사용하려면 구성이 필요한 것 아닐까요? ? ?

답변1

"컴파일러"는 설치해야 하는 별도의 패키지입니다. "build-essential"이라는 패키지 g++는 별도로 설치되거나 "build-essential"이라는 패키지에 포함될 수 있습니다.

이렇게 하면 sudo apt-get install build-essential문제가 해결되고( sudo apt-get install g++또한 작동해야 함) cmake ..구성 없이도 작동합니다.

답변2

알파인에서도 같은 문제가 발생했습니다. 다음 라이브러리를 설치한 후 모든 것이 예상대로 작동했습니다.

apk add git cmake make clang build-base llvm-static llvm-dev clang-static clang-dev

답변3

CenOS 변형 배포판의 경우 nasm. 이를 설치하면 문제가 해결됩니다.

yum install -y nasm 

답변4

먼저 eCAL 압축 패키지(최신 버전)를 다운로드하여 설치하세요. 터미널 유형으로 이동:

sudo apt-get update
sudo apt-get install ecal
sudo apt-get install build-essential
sudo apt install cmake g++ libprotobuf-dev protobuf-compiler
sudo apt-get update

관련 정보