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

emadb picture emadb  ·  5Comments

manikantag picture manikantag  ·  4Comments

0x7FFFFFFFFFFFFFFF picture 0x7FFFFFFFFFFFFFFF  ·  3Comments

spacesuitdiver picture spacesuitdiver  ·  3Comments

StayFoolisj picture StayFoolisj  ·  5Comments