Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97400

Visual Studio Code Fails to find WSL

$
0
0

I'm trying to compile some C code in visual studio with gcc using WSL.

I've got a super simple configuration that executes on an F5 Press

"version": "0.2.0",
"configurations": [
    {
        "name": "Build And Run",
        "type": "cppvsdbg",
        "request": "launch",
        "program": "${workspaceFolder}/.vscode/BuildAndRun.bat",
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "externalConsole": true,
        "environment": [],

    },]

Which then should execute the batch file that contains a simple call to wsl and gcc

@echo off
wsl gcc main.c
pause

When I run this bat file by clicking on it, it works and everything compiles. however when I press F5 I get an error that 'wsl' is not recognized as an internal or external command. I've tried adding it to Path and that didnt help. I should also add that when I run the command inside the vs terminal it works, which just confuses me even more.


Viewing all articles
Browse latest Browse all 97400

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>