0

enter image description here

I am learning c language and vscode. I am trying to compile the c code in VSCODE but it ran into this problem. Please help thnk you in advance!

This is the code i am trying to compile:

#include <stdio.h>

int main(void)
{
    printf("Hello World!\n");
}

When i try to run in the windows terminal

make hello

this is the output

cc     hello.c   -o hello
process_begin: CreateProcess(NULL, cc hello.c -o hello, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [<builtin>: hello] Error 2

I tried checking for the latest version of the 'make' and 'gcc'

apoishh
  • 1
  • 2
  • Does this answer your question? [Makefile error make (e=2): The system cannot find the file specified](https://stackoverflow.com/questions/33674973/makefile-error-make-e-2-the-system-cannot-find-the-file-specified) – Nathan Jiang Jun 07 '23 at 02:02
  • 1
    i notice it uses cc instead of gcc. how do i implement this [link](https://stackoverflow.com/a/71927490/21769031) – apoishh Jun 07 '23 at 02:20
  • 2
    Do not present images of code or text output. Present the text itself, appropriately formatted. – John Bollinger Jun 07 '23 at 02:25
  • @apoishh – You _implement this_ by writing it in your makefile. – Armali Jun 07 '23 at 06:48
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jun 07 '23 at 11:35

1 Answers1

0

Here´s a few things you should look out for:

  • Is the source directory in the Makefile specified correctly?
  • Is the source file in the correct location?
  • Are the file names correct?

These are (to my little experience) some of the most common mistakes with Makefiles. Please provide the Makefile and maybe your file structure for more detailed help.

heftiq
  • 7
  • 2