In the File Explorer title bar, select the New File button and name the file helloworld.cpp.
MINGW MAKE CODE
" command opens VS Code in the current working folder, which becomes your "workspace". Then create a sub-folder called helloworld, navigate into it, and open VS Code in that folder by entering the following commands: mkdir projects cd projects mkdir helloworld cd helloworld code. Create Hello Worldįrom a Windows command prompt, create an empty folder called projects where you can place all your VS Code projects.
MINGW MAKE INSTALL
If the compilers do not exist at that PATH entry, make sure you followed the instructions on the MSYS2 website to install Mingw-w64. If you don't see the expected output or g++ or gdb is not a recognized command, make sure your PATH entry matches the Mingw-w64 binary location where the compilers are located. To check that your Mingw-w64 tools are correctly installed and available, open a new Command Prompt and type: g++ -version gdb -version
![mingw make mingw make](https://perso.uclouvain.be/allan.barrea/opencv/_images/mingw_install_3.png)
You will need to reopen any console windows for the new PATH location to be available. If you used the settings above to install Mingw-w64, then add this to the path: C:\msys64\mingw64\bin. The exact path depends on which version of Mingw-w64 you have installed and where you installed it.
![mingw make mingw make](https://i.stack.imgur.com/QW6rs.png)
If you have any problems, feel free to file an issue for this tutorial in the VS Code documentation repository. For those subjects, there are many good resources available on the Web. This tutorial does not teach you about GCC, GDB, Mingw-w64, or the C++ language. In this tutorial, you configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from mingw-w64 to create programs that run on Windows.Īfter configuring VS Code, you will compile and debug a simple Hello World program in VS Code.