paint-brush
How to Compile C/C++ Code in VS Code (Windows)by@nobody1234
11,252 reads
11,252 reads

How to Compile C/C++ Code in VS Code (Windows)

by nobody
nobody HackerNoon profile picture

nobody

@nobody1234

Love to write, Software developer, freelancer, machine learning

March 16th, 2021
Read on Terminal Reader
Read this story in a terminal
Print this story
Read this story w/o Javascript
Read this story w/o Javascript

Too Long; Didn't Read

How to Compile C/C++ Code in VS Code (Windows): To compile C/C++ code we need GCC/G++ to compile the code but Windows doesn't have a terminal.

Company Mentioned

Mention Thumbnail
Microsoft
featured image - How to Compile C/C++ Code in VS Code (Windows)
1x
Read by Dr. One voice-avatar

Listen to this story

nobody HackerNoon profile picture
nobody

nobody

@nobody1234

Love to write, Software developer, freelancer, machine learning

About @nobody1234
LEARN MORE ABOUT @NOBODY1234'S
EXPERTISE AND PLACE ON THE INTERNET.

Compile your C/C++ code in Windows using Visual Studio code

So in this article, I’ll show you how you can compile your C/C++ code in Windows. To compile C/C++ code we need GCC/G++ to compile the code but Windows doesn't have a terminal like the Linux terminal or Mac terminal.

So instead, to compile your code in Windows VS Code, we need an extension called the C/C++ Compile Run extension.

To install it, you need to open your VS Code and goto extensions (shown in the below image ) and search for C/C++ Compile Run by danielpinto8zz6, install it.

image

Your 1 step is completed, now you need to install MinGW.

It is a free and open-source software development environment to create Microsoft Windows applications.

Go to its official site in the navigation section download.

image

Click on download and it will redirect you to the download page and click on

The windows icon like shown in the below image after the download installs it.

image

After successfully installation open MinGW Installation Manager.

image

It will look like the image. Click on "basic setup" and click on "all packages". Then, go to installation and click on "apply changes", it will take some after successfully applied.

You need to do one more thing to setup the environment.

image

Open your System Properties and click on Environment Variables.

image

Now select on System variables Path and click on edit.

image

Now click on new and go to Browse and in C drive find the MinGW folder and select bin folder.

image

That’s it - your environment has been setup.

Now you can compile your C/C++ code in your VS Code by pressing f6 on your keyboard.

That’s all about the code compilation in Windows. If you have any kind of doubt you can ask me or you can see my video.

I hope this helps you if you have any query feel free to ask.

Previously published at https://laptrinhx.com/how-to-compile-c-c-code-in-vs-code-windows-2735242511/

https://www.subpals.com/?ref=8046

L O A D I N G
. . . comments & more!

About Author

nobody HackerNoon profile picture
nobody@nobody1234
Love to write, Software developer, freelancer, machine learning

TOPICS

THIS ARTICLE WAS FEATURED IN...

Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Coffee-web
Buzzsumo
Hashnode

Mentioned in this story

companies