找不到make,我该如何解决?

时间:2021-01-03 15:23:28

标签: c++ visual-studio-code

我有这个输出:

制作:

<块引用>

术语“make”不被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,如果包含路径,请验证路径是否正确,然后重试。

At line:1 char:1

+ make --directory=".output\"
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (make:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

1 个答案:

答案 0 :(得分:2)

假设安装了make。您需要将 make 的位置添加到 typedef enum {SHORT= 1, MEDIUM, LONG, OTHER} hair; typedef struct{ ... hair type; }record; record subj[DIM_RECORD]; printf("\ntype= "); printf("\n\t%d) SHORT",SHORT); //Output= 1)Short etc printf("\n\t%d) MEDIUM",MEDIUM); printf("\n\t%d) ILONG",LONG); printf("\n\t%d) OTHER",OTHER); isEnum(subj->type); void isEnum(int* i){ do { scanf("%d", &i); if (*i>=1 && *i <= 4) break; printf("\nError"); printf("\ntry again "); }while(1); }

您可以在设置/系统属性/环境变量中进行设置;您可以在系统变量或用户变量中执行此操作。

您可以使用 $path 验证它是否在您的路径中。

如果您使用包含的 WSL make(gmake for GNU/linux,通常是为了使用 gcc 构建 GNU/Linux 可执行文件),您可以在您的 {{ 1}}。您可以使用 Get-command make 检查您是否在 powershell shell 中安装了它,如果没有,您需要从应用商店安装 WSL 发行版。

如果您为 Windows 构建,则需要安装它How to install and use "make" in Windows?

为了检查您需要哪一个,您需要打开文件 make -> bash -c make,并检查调用了哪些程序(gcc 或其他程序)。