build-essential pulls gcc, g++, make and libc-dev together. CMake declares LANGUAGES C CXX so it needs a C compiler (cc) too – individual g++ install can leave gaps that build-essential covers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>