VS Code block after running When I am running my c programming code in VS Code, why is it showing a msg as "no such file or directory"?
How to resolve this issue?
I had made a file and then I wrote the code and saved it then clicked run.
And then clicked on terminal and then typed gcc... gcc filename.c
. I have already installed extension of c/c++, code runner yet the problem still persists.
2
Answers
Make sure you are opened into the right directory in visual studio code. In the upper left hand corner you will see What folder you are in. Use cd commands in the terminal like:
and direct it to the right directory. Then try compiling again.
You are editing
mymain.c/testcode.c
, but you are attempting to compiletestcode.c
.One solution is to switch into
mymain.c
Alternatively, you could provide the correct path.
Your choice will affect the default location of the output files, as well as the base directory for
#include "..."
directives (but it doesn’t affect#include <...>
directives).