In this article we are going to learn how to setup complete c and c++ development environment in Visual studio code, this is the easy and efficient process compared to the process which is given in Visual studio code official website.
Why should i use Visual Studio code?
- Visual code has one of the best GUI( Graphical user Interface) and make your code clean and easy to read.
- Large number of extensions are present in Visual code for faster and versatile coding experience.
- Auto-completion of code and keyword which is very great feature for beginners.
- Small in size and does not very demanding in term of hardware.
- Great debugging features to help user in inspecting the code.
- You should have the latest version of MinGW( it is a native window port of the GNU Compiler collection (GCC) ) install on your computer system, if not you can head towards the following link and can download the software according to your system operating system and architecture.
- Download Visual Studio Code software from official site. Note:- Download the community version, it is free of cost.
- Connect to your internet connection for installing MinGW using the setup.
Steps to install MinGW and add environment variable path on your system:-
- open the .exe file and click on install button by selecting the directory for installation, it will download some files and then redirect you into new page.
- In this page check the box which says mingw32-gcc-g++.bin.
- Then click on Installation located at top-left menu and then click on apply changes.
- It will download and install the files, it might take several minutes depending on your internet connection.
- Now you are done with mingw installation ,lets add the environment variable path.
- Go to the directory where you install the mingw then go to the bin folder and copy the path location by clicking on the upper tab next to search bar.
- Now head to this location System info->advance system settings-> environment variables->click on path present in 2nd tab and click edit-> click new and copy the path location of mingw bin folder-> click ok.
- Now you are pretty much done, just check that the path is added successfully or not by opening cmd and typing "path". If you can see the mingw bin path, you are good to go.
STEPS TO SETUP VISUAL CODE FOR C/C++:-
- Go to Extension tab and download c/c++ Intellisense extension and install the extension on your device.
- Now you can write the "hello world" program in c/c++ language to check that all things are working as expected.
- You can also change the themes and looks of the editor easily in settings menu.
If you followed the all the steps correctly there should not be any problem in setting Visual code for c/c++, if not you can comment down the problems and error. Thank you and enjoy the fast and smart coding experience.