Having trouble troubleshooting C++ code in Visual Studio Code

Recently, I downloaded Visual Studio Code v1.7.1 to work on my c++ coding assignments for my degree program. While my programming skills are at a basic level, I am quite impressed with VS Code, except for one thing - I have no clue how to debug or build my code.

I've gone through several online questions related to this topic, such as: How do I set up VSCode to compile C++ code? and attempted to follow the instructions mentioned in tasks.json file, like using the make command and g++ command. However, every time I try to execute it, I encounter an error message:

'make' is not recognized as an internal or external command, operable program or batch file.

When I attempt to run the debugger, it prompts me to set up the launch.json file. Following the given instructions, I input the file path under 'program' but unfortunately, it gives me the error:

Unknown Error: 0x800700c1

I'm seeking the simplest solution that will enable me to write and debug code in VS Code, similar to how it's done in the full version of Visual Studio, minus the complexities of project filing systems and lengthy loading times. Any assistance on this matter would be highly valued.

Answer №1

It seems from your question and the feedback provided that you currently do not have a functional C++ compiler or buildchain set up. There are various compilers to choose from, such as minGW and GCC.

Despite the options available, Microsoft recommends the following course of action:

Setting up C/C++ build tools

To acquire a bundle of C/C++ compilers for Windows, consider downloading the Visual C++ build tools SKU. By default, these tools will be installed in 'C:\Program Files (x86)\Microsoft Visual C++ Build Tools'.

I have not personally used the Visual C++ compiler, but it appears to be the simplest way to kickstart your C++ programming journey.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ways to emphasize a particular <li> element?

Currently, I am delving into the world of React and facing a challenge. I have been trying to solve the issue below: When fetching some JSON data, it appears in this format: [ { "answerOptions": [ "Answer A", "Answer B", ...

Updating the value of a different key within the same object using React Formik's setFieldValue方法

My objective is to automatically select a value in an option select when the onChange event occurs, and then use setFieldValue to set values for 2 Fields with key-value pairs within the same object. The issue I'm facing: Why does calling setFieldValu ...

Efficient method for deleting a specific item from a JSON object in React.js

Within the REACT JS framework, I am managing a JSON object in the state component "myrecords". The items within this object are organized by their respective Company Names and have the following structure: { "Master Automotives": [ { ...

What are the benefits of adding member functions to the data structures of React.js store?

Using React.js and Typescript, I store plain Javascript objects in the React.js store. These objects are sometimes received from the server without any member functions, but I wish to add functions for better organization. Instead of having to rely on exte ...

Preparing my JSON data for visualization on a chart

I have successfully retrieved data using this API, but now I need to transform it into a chart within my react project. As a newcomer to JS and React, I am struggling to create a chart with the JSON data. My objective is to display prices by bedrooms over ...

NextJS - Error: Invalid JSON format, starting with a "<" symbol at position 0

After following a tutorial on NextJS, I attempted to make some modifications. My goal was to include the data.json file on the page. However, I kept encountering the error message "Unexpected token < in JSON at position 0." I understand that I need to con ...

Accessing JSON data stored locally and initializing it into a TypeScript variable within a React application

I'm new to working with JSON arrays and I'm facing a challenge. I am looking for a way to load data from a JSON file into a Typescript variable so that I can perform a specific operation that involves arrays. However, I'm unsure of how to ac ...

Issue with optimizing in Webpack 4

It's past 2am and I find myself going crazy trying to identify an error. The console keeps repeating the message: "Error: webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead." I've attempted modifyi ...

Accessing a specific data point from a Rest Api with React JS

How can I extract the value '00000000000000000000000000000000' that comes after clusters in the links->href in a Rest Api response? [{ "analysisUnits": [ { "links": [ { "href": "http://127.0. ...

Having trouble retrieving a value from a .JSON file (likely related to a path issue)

My React component is connected to an API that returns data: class Item extends Component { constructor(props) { super(props); this.state = { output: {} } } componentDidMount() { fetch('http://localhost:3005/products/157963') ...

Function not executing on button press in React.js

I am trying to trigger a function upon clicking a button, but unfortunately, nothing is happening. Despite adding a console.warn() statement inside the function, it doesn't seem to be logging anything. I've looked through similar Stack Overflow s ...

Enhance the editing capabilities of the Json data form

https://i.stack.imgur.com/YZIjb.png My goal is to enhance a form for editing json data by moving beyond the typical <textarea /> tag and making it more user-friendly. Are there any tools available that can help improve the form's usability? Add ...

React is unable to access the value of a JSON local file within a component

I'm currently working on extracting a value from a local json file. Despite no errors, the value is not displaying when viewed in the browser. Initially, I am utilizing a local json file, but I plan to switch to an endpoint in the future. Within Hea ...

Using getStaticPaths and getStaticProps with moralis query for dynamic data fetching

I've been trying to getStaticPaths and getStaticProps to work, but I feel like I might be overlooking something. I attempted querying inside each of them, which seems redundant, but I'm not sure how else to do it. Can someone provide an example? ...

Avoiding repetition in json array using reactjs with the help of axios

After receiving guidance from @Akrion, I managed to resolve the issue! Check out my comments below our conversation for the solution. I am relatively new to reactJS and axios, but I recently collaborated with a classmate on a project. Now, I find myself s ...

I'm in the process of constructing a create-next-app and I need to retrieve data from a web API. However, I'm unsure of the best place to securely store the API key

I am working on building a create-next-app that will retrieve data from the News Catcher API and display it within my application. I have obtained an API key to access the News Catcher API. However, I am unsure of where to securely store the API key and h ...

What is the most effective way to import a substantial static array in React for utilization in a select field?

The scenario is quite straightforward. I currently have a single array containing over 2500 strings of company names, saved locally in the project as a JSON file within a subdirectory under src. To access this data in my component, I am importing the JSON ...

Updating ES6 syntax for superset in array: a step-by-step guide

I am currently working with ES6 React code that generates an array of MiniIcons on a webpage. const MiniIcons = ({miniicons}) => ( <div id="application"> {miniicons.map(miniicon => ( <MiniIcon key={miniicon.id} id={miniicon.id} ...

The command `node server.js` has been initiated. Nodemon has executed a clean exit and is now waiting for any

A React application has been developed where users can input their email and a message to send to the server. However, upon trying to send the message, Error number 2 is encountered along with viewing Error number 1 in the terminal. Despite ensuring that ...

Is there a way to trigger a function from a specific div element and showcase the JSON data it retrieves in

I am working with a React JS code page that looks like this: import React, { useState } from "react"; import { Auth, API } from "aws-amplify"; function dailyFiles(props) { const [apiError502, setApiError502] = useState(false); // Extracted into a re ...