./configure: Error: C Compiler Cc Is Not Found Ubuntu

Article with TOC
Author's profile picture

Kalali

Jun 07, 2025 · 3 min read

./configure: Error: C Compiler Cc Is Not Found Ubuntu
./configure: Error: C Compiler Cc Is Not Found Ubuntu

Table of Contents

    ./configure: error: c compiler cc is not found Ubuntu: A Troubleshooting Guide

    This frustrating error, "./configure: error: c compiler cc is not found," often pops up when trying to compile software from source on Ubuntu. It simply means the build system can't locate a C compiler to translate your code into machine-executable instructions. This guide will walk you through the common causes and effective solutions. Understanding the underlying issue is key to resolving it efficiently.

    Understanding the Error

    The ./configure script is a common part of many open-source software packages. Its purpose is to detect your system's configuration, including the presence of necessary compilers, libraries, and header files. When it fails to find the cc compiler, the build process halts. This isn't a problem with the software itself; it's a problem with your development environment.

    Common Causes and Solutions

    The most frequent reasons for this error are:

    • Missing or Incorrectly Installed Compiler: The most obvious culprit is the absence of a C compiler. Ubuntu typically uses GCC (GNU Compiler Collection).

      • Solution: Install the GCC compiler using the following command in your terminal:
        sudo apt update
        sudo apt install build-essential
        
        build-essential is a meta-package that installs GCC, G++, and other essential build tools. This is often sufficient to resolve the issue.
    • Incorrect PATH Environment Variable: Even if GCC is installed, the ./configure script might not find it if the compiler's location isn't included in your system's PATH environment variable. The PATH tells the system where to look for executables.

      • Solution: You can temporarily check if the compiler is accessible by using its full path:
        /usr/bin/gcc --version
        
        If this shows the compiler version, the issue lies with the PATH. You should not permanently modify your PATH directly. Instead, source the setup script for your software if one exists or use a build environment.
    • Multiple Compiler Installations: Conflicting compiler installations can also cause problems.

      • Solution: Identify and remove any redundant or conflicting compiler installations. Use apt list --installed | grep gcc to list your installed GCC versions. Consider removing the unwanted versions if found.
    • Permissions Issues: Less common but possible, permissions issues can prevent the ./configure script from executing correctly or accessing necessary files.

      • Solution: Ensure you have appropriate permissions for the directory containing the source code. Try using sudo before running ./configure if you suspect permission issues. However, this is usually only necessary for installing software in system directories.
    • Using the Wrong Compiler Name: While cc is a common alias for GCC, some systems may use gcc directly.

      • Solution: If other troubleshooting steps fail, try explicitly invoking the GCC compiler using gcc instead of cc during compilation. Most ./configure scripts are intelligent enough to detect this.

    Advanced Troubleshooting Steps

    If the problem persists after trying the above solutions:

    • Check your system's logs: Examine system logs using commands like dmesg or journalctl to identify any further clues. This might reveal errors not displayed directly to the user.
    • Rebuild the environment: If you are using a virtual machine or container, rebuilding it from scratch might resolve underlying issues with the compiler installation.
    • Examine the configure script: In rare cases, you might need to analyze the ./configure script itself to pinpoint the exact cause of the error. However, this generally isn't necessary for common applications.

    By systematically addressing these potential causes, you should successfully overcome the "./configure: error: c compiler cc is not found" error and continue compiling your software. Remember to always use sudo with caution, understanding its implications. If you're unfamiliar with the command line, consider consulting additional tutorials.

    Related Post

    Thank you for visiting our website which covers about ./configure: Error: C Compiler Cc Is Not Found Ubuntu . We hope the information provided has been useful to you. Feel free to contact us if you have any questions or need further assistance. See you next time and don't miss to bookmark.

    Go Home