Search code examples
cgccclion

How to fix "gcc isn't recognized as internal command" on Clion for Window?


I followed the Clion installation guide and I installed MinGW.

So now I coded a C program and I try to type in the terminal gcc test.cbut I get gcc isn't a recognized internal command

Here is my program :

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>

struct a_struct {int a; int b; int c;};

int main()
{

    struct a_struct* pa = (struct a_struct*) 1000;
    printf ("pa=%ld\n", (long)pa);

    struct a_struct* pb = &pa[10];
    printf ("pb=%ld\n", (long)pb);

    struct a_struct* pc = pa + 10;
    printf ("pc=%ld\n", (long)pc);

    struct a_struct* pd = pc--;
    printf ("pc=%ld, pd=%ld\n", (long)pc, (long)pd);

    struct a_struct* pe = ++pb;
    printf ("pe=%ld, pb=%ld\n", (long)pe, (long)pb);

    return 0;
}

And in Clion settings I have:

enter image description here


Solution

  • You shall add to PATH environment variable (either user or system wide) the path to gcc.exe (which typically resides @ C:\MinGW\bin)