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.

Community
  • 1
  • 1
Harry Cooke
  • 1
  • 1
  • 1
  • Have you read the manual pages. Perhaps one of the menu options compiles the code )CTRLF9 as I recall but could be wrong) – Ed Heal Nov 19 '16 at 15:13
  • 1
    Are you sure you even have a compiler installed? Afaik Visual Studio Code is just an editor. – Fang Nov 19 '16 at 15:16
  • Looks like you're missing make. It is typically packaged separately from gcc. What OS and tool chain are you using? – user4581301 Nov 19 '16 at 15:20
  • Yeah that's the thing, I figured I need something like that but I've no idea what or how - I tried searching for an answer but my knowledge was far too limited to come up with a search term like compiler. – Harry Cooke Nov 19 '16 at 15:21
  • So are you running on Windows or Linux? Have you ever compiled code on your machine before? – Fang Nov 19 '16 at 15:22
  • My OS is windows 10, and given that I don't know what a tool chain is my best guess is I'm not using one. – Harry Cooke Nov 19 '16 at 15:22
  • I've debugged code in visual studio 2015 before, that's about the extent of my knowledge. – Harry Cooke Nov 19 '16 at 15:23
  • http://www.mingw.org/ is probably the path of least resistance to get you started. – user4581301 Nov 19 '16 at 15:26

1 Answers1

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.

Fang
  • 2,199
  • 4
  • 23
  • 44