Software⏱️ 2 min read📅 2026-06-03

How to Fix: CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found

CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found. Solution involves setting environment variables for GCC compiler.

Quick Answer: Set the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER environment variables to point to the GCC compiler executable, e.g., C:\Program Files\GCC\gcc.exe.

The error 'No CMAKE_C_COMPILER could be found' occurs when the compiler specified in your project's build settings cannot be located by CMake. This is often due to issues with the installation or configuration of GCC, as you have done.

🛑 Root Causes of the Error

  • Incorrect GCC installation location
  • Lack of environment variable 'CMAKE_C_COMPILER' set
  • Visual Studio 2015 not properly configured for CMake

🔧 Proven Troubleshooting Steps

Method 1: Update GCC Installation Location

  1. Step 1: Locate the GCC installation directory and add it to your system's PATH environment variable.

Method 2: Set Environment Variable

  1. Step 1: Open your system's environment variables settings (usually found in Control Panel or System Properties).
  2. Step 2: Add the GCC installation directory to the PATH variable.

Method 3: Configure Visual Studio 2015 for CMake

  1. Step 1: Open your project's properties in Visual Studio 2015.
  2. Step 2: In the 'Configuration Properties' section, navigate to 'VC++ Directories' and add the GCC installation directory for the 'Include directories' and 'Library directories' fields.

🎯 Final Words

By following these steps, you should be able to resolve the 'No CMAKE_C_COMPILER could be found' error and successfully compile Aseprite using CMake with Visual Studio 2015.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions