如何为 Window 修复 Clion 上的 "gcc isn't recognized as internal command"?
How to fix "gcc isn't recognized as internal command" on Clion for Window?
我关注了Clion installation guide and I installed MinGW.
所以现在我编写了一个 C 程序并尝试在终端中输入 gcc test.c
但我得到 gcc isn't a recognized internal command
这是我的程序:
#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;
}
在 Clion 设置中我有:
您应将 gcc.exe 的路径(通常位于 @ C:\MinGW\bin)
添加到 PATH 环境变量(用户或系统范围)
我关注了Clion installation guide and I installed MinGW.
所以现在我编写了一个 C 程序并尝试在终端中输入 gcc test.c
但我得到 gcc isn't a recognized internal command
这是我的程序:
#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;
}
在 Clion 设置中我有:
您应将 gcc.exe 的路径(通常位于 @ C:\MinGW\bin)
添加到 PATH 环境变量(用户或系统范围)