Vscode-code-runner: I get error "No such file or directory" when I compile C code using gitbash as terminal

Created on 18 Apr 2018  Â·  5Comments  Â·  Source: formulahendry/vscode-code-runner

Here is the output info:

$ cd "d:\VscodeProject\C\demo\" && gcc file1.c -o file1 && "d:\VscodeProject\C\demo\"file1
bash: cd: d:\VscodeProject\C\demo" && gcc file1.c -o file1 && d:VscodeProjectCdemo"file1: No such file or directory

How can I fix it?

Most helpful comment

What's the path of your Git Bash?
Could you set "code-runner.terminalRoot": "/", and try again?

All 5 comments

What's the path of your Git Bash?
Could you set "code-runner.terminalRoot": "/", and try again?

@formulahendry, it works. Thank you for the prompt reply.

I didn't get the answer please elaborate

Guys I was trying to execute C programme for last 3 days but didn't get the answer but today I worked hard and finally it worked for me.

Please try this for C programme
"c": "gcc $fileNameWithoutExt.c -o $fileNameWithoutExt && ./$fileNameWithoutExt.exe"

for cpp
"c": "g++ $fileNameWithoutExt.c -o $fileNameWithoutExt && ./$fileNameWithoutExt.exe"

it works. thx!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

w3adventures picture w3adventures  Â·  3Comments

ElektroStudios picture ElektroStudios  Â·  4Comments

eegod picture eegod  Â·  5Comments

StayFoolisj picture StayFoolisj  Â·  5Comments

Kelo007 picture Kelo007  Â·  3Comments