ccs50

process_begin: CreateProcess(NULL, g++ Hello.C -o Hello, ...) failed. make (e=2): The system cannot find the file specified


I'm trying to make a file into a program on VScode with the Bash terminal, but it reports the above error. I'm relatively new to programming as a whole and trying to follow along with the CS50 course uploaded online; please forgive any incompetence.

below is the entire problem

$ make Hello CC=gcc
g++     Hello.C   -o Hello
process_begin: CreateProcess(NULL, g++ Hello.C -o Hello, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [<builtin>: Hello] Error 2

Solution

  • I am under the assumption you are using Windows. Which is very likely your problem. Under Windows, C Compilers aren't preinstalled, and the compiler you are trying to use (GCC/G++) is a Linux exclusive. MinGW is the Windows equivalent.

    From personal experience, programming C under Windows is a hassle, so I can recommend you use WSL (Windows Linux Subsystem) and the corresponding VSCode extension, wich allows you to code in VSCode under Windows with the Terminal, Code and Filesystem running in Linux.

    If you were watching this Video, the Prof is using Github codespaces an online cloud service his code runs on (also Linux).