Jump to content

Error in VScode when trying to run code in C

Anshu sharma

When i try to run code in VScode of C, I get this error "cl.exe build and debug is only usable when VS Code is run from the Developer Command Prompt for VS."

 What is this error and how can I fix it, can any one help me.

 

I am just starting to learn programming, I only have prior knowledge in QBASIC(Interpreter) and in HTML+CSS, and now learning C as it is in my course material for grade 10.

This code written is just a random code i found on the internet, i don't know hat it dose nor do i know if it has anything wrong.

 

VSCODE error in c .png

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Anshu sharma said:

When i try to run code in VScode of C, I get this error

To run c code in vscode with visual studios complier, you need to run the vscode editor from the visual studio build tools environment. This explains how to 

https://code.visualstudio.com/docs/cpp/config-msvc#_run-vs-code-outside-the-developer-command-prompt

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×