I have recently switched to Windows 10 from PopOs ( a Debian-based Linux) because of my project-related work which could not be done in any Debian-based Linux. So, I installed windows 10 on my system and it was just a little annoying but cool as well because my system's performance has increased (which was obvious as I have deleted all my previous data just backed up around 60Gb of it).
If you found any problem regarding setting up the environment, you can say it in the comments or reach via the given contact form.
So, starting with the process of setting up the environment for C++ on the VS Code on Windows 10. In Linux, I used to run C++ files on Sublime text only but on Windows, I'm just using VS code for both C++ and JavaScript.
Let's start setting up the environment. I am dividing this whole process into 4 steps:
- First, you have to set up a compiler for the system. As we know that C/C++ is compiled programming language which requires a compiler to make them compiled and run. In Linux, there is already a gcc/g++ compiler preinstalled. But in Windows, you have to install it separately. So you can download MinGW-w64 for windows 10 from here.
- After installing the MinGW compiler, you have to set up the PATH variable for it.
- First, go to the Start button and search for setting and open that.
- Now search Edit environment variables for your account.
- Select Path and click the edit button.
- Now click new and add the path of the bin folder of mingw64.
- After adding the path variable, now open VS code (Download it from here if you have not installed it already). Then open a new CPP file in the window.
- Now your C++ environment is set.
Let's give it a try, go to your PowerShell and type ./{name_of_your_cpp_file}. Boom it's running.
For IntelliSense and debugging, use the C/C++ extension from Microsoft.
Thanks
Comments
Post a Comment