sourav roy
sourav roy

Reputation: 21

command 'gcc' not found in windows subsystem for linux

I have been trying to run some c files through wsl(ubuntu 20.04). I have set the path to the executable file in my windows env variable. It works good in cmd/powershell but as mentioned here we can access the windows env variables in wsl so I have tried running the command gcc -v in wsl but it says Command 'gcc' not found . Faced same issue with nodejs. Command 'node' not found but surprisingly when I type node.exe it worked! here is the screenshot

Why is it so? How to resolve the issue with gcc? Do i need to install gcc compiler for WSL separately?

Upvotes: 0

Views: 1867

Answers (1)

Thibault Poncetta
Thibault Poncetta

Reputation: 59

try download binaries of gcc.exe and put it in a folder and add it in your PATH. Then you should be able to run gcc.exe in your WSL.

for me, was using MinGw and put all the binary for my sub system in /bin directory (added it to path, work perfectly)

Upvotes: 1

Related Questions