Unable to debug c++ code in Visual Studio Code

0

I've just installed Visual Studio Code v1.7.1 to write my c++ code in for my degree. My programming level is pretty basic, but I like what I've seen of VS Code so far, save for the fact that I've no idea how to debug or build my code.

I've looked at a few questions on the topic, such as: How do I set up VSCode to compile C++ code? and have tried implementing some of these into the tasks.json file, including the make command and the g++ command, but when I try and execute it I get the error:

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

or something similar. When I try running the debugger, it tells me to set up the launch.json file, so I entered the path of my file where it says 'program' as the instructions imply, I get the error

Unknown Error: 0x800700c1

I'm just looking for the simplest option that will allow me to write and debug code in vs code, in a manner similar to using the full version of visual studio, but without the heavy project filing system or the 10 minute loading times. Any help would be greatly appreciated.

c++
json
visual-studio-code
asked on Stack Overflow Nov 19, 2016 by Harry Cooke • edited May 23, 2017 by Community

1 Answer

1

What I deduce from your question and the comments is that you have no actual C++ compiler/buildchain installed. There are multiple compilers available (like minGW, GCC).

However, what Microsoft recommends is the following:

Installing C/C++ build tools

To obtain your set of C/C++ compilers on Windows you can grab the Visual C++ build tools SKU. By default these tools are installed at ‘C:\Program Files (x86)\Microsoft Visual C++ Build Tools’.

I have not tested, nor ever worked with the Visual C++ compiler, but it's probably the easiest way to get started right away.

answered on Stack Overflow Nov 19, 2016 by Fang

User contributions licensed under CC BY-SA 3.0