- Visit https://code.visualstudio.com/docs/languages/cpp to set up the compiler.
- Choose C++ on the sidebar.
- Pick one of the choices under “GCC through Mingw-w64 on Windows” from the list.
- Choose the option to install SourceForge.
- Run the setup programme once the downloading is complete, and then select all of the default options, just as we did when installing Visual Studio Code.
Setting Compiler’s Path
- Navigate to the directory C. Enter the Program Files directory. Open MinGW-64 next. Fire up MinGW-32. the bin folder follows. Save the path or URL to the bin once you’ve reached it.
- then visit “This PC’s” properties.
- “Advanced System Settings” should be chosen.
- Choose “Environment Variable” from the menu.
- Change the environment variable to include the copied path.
- You may now access your IDE and start running C++ programmes there. Configuration is complete.
Creating your first C++ programme
Launch VSCode. Here is the most basic print statement we can use to get started.
#include <iostream>
int main()
{
std::cout << "Hello World";
return 0;
}
Output:
Hello World