question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

109reactions
formulahendrycommented, Apr 18, 2018

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

7reactions
RockerSurajThakurcommented, Aug 9, 2020

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”

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode: Code Runner extension is unable to execute the ...
I am trying to run a simple program "primeRange.cpp" using Code Runner extension available for VSCode. I have selected my default terminal as ......
Read more >
Terminal Shell Integration in Visual Studio Code
Visual Studio Code's embedded terminal can integrate with some shells to enhance the ... Run code ~/.bashrc in Git Bash to open the...
Read more >
Copy your Git repository and add files | Bitbucket Cloud
Open a browser and a terminal window from your desktop. After opening the terminal window, do the following: Navigate to your home directory....
Read more >
Get started using Git on WSL - Windows - Microsoft Learn
Learn how to set up Git for version control on the Windows Subsystem for Linux, along with Git Credential Manager.
Read more >
Fix Error: GCC/G++ No such file or directory - YouTube
How to fix error GCC/G++ No such file or directory - fatal error ... How to Fix Include Path Error in C /C++...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found