简体   繁体   中英

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?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM