Home > Back-end >  When I try to compile c source code with mingw, I get an error that says no such file or directory
When I try to compile c source code with mingw, I get an error that says no such file or directory

Time:12-28

I've read countless posts related to this to no avail, I still haven't found a solution for my problem. I don't understand why it can't find the file. It's looking in the directory where the file is. Any ideas on how I can get this work?

I type g test.cpp, and after that is when I get the error.

Edit: I'm on windows. Also, I did add the g directory to PATH. This is the command I used: g test.cpp. After that, this is the output:

g .exe: error: test.cpp: No such file or directory

g .exe: fatal error: no input files compilation terminated.

Sorry, I tried to format that properly with the backticks but it keeps cutting off some of the words. This is my first time using stack overflow so I'm not sure if there's a different way I'm supposed to be formatting it.

CodePudding user response:

Have you added g to path yet?

CodePudding user response:

You need to include more detail in your question. What is the OS you are using? What is the output after you run the command?

  • Related