Install Tiny C Compiler on Ubuntu 26.04

Install Tiny C Compiler on Ubuntu 26.04

Tiny C Compiler (TCC) is a lightweight C compiler designed for fast compilation and minimal resource usage. It is often used for quick testing and simple C programs. This tutorial demonstrates how to install Tiny C Compiler on Ubuntu 26.04.

Install Tiny C Compiler

Make sure that the package lists are up-to-date:

sudo apt update

Install the Tiny C Compiler:

sudo apt install -y tcc

Verify that the compiler is available by checking version:

tcc --version

Testing Tiny C Compiler

Create a sample C source file:

nano main.c

Add the following code:

#include <stdio.h>

int main() {
    printf("Hello world\n");

    return 0;
}

Compile the program using Tiny C Compiler:

tcc main.c -o test

Run a program:

./test

Uninstall Tiny C Compiler

To fully remove Tiny C Compiler along with unused dependencies, execute:

sudo apt purge --autoremove -y tcc

Leave a Comment

Cancel reply

Your email address will not be published.