Install Clang and Visual Studio Code on Ubuntu

Visual Studio CodeClang is very easy to install. Open a terminal and issue this command:

sudo apt install clang

It takes a little bit more for Visual Studio Code (aka VS Code). Start on the download page of VS Code. Just google for download Visual Studio Code or click here. Click the Deb rectangle and pick the Open with Software install (default) an that will install it.

After that is installed, run VS Code (open a terminal and type code) and click the extensions icon (5th down on the left) and type in C++ in the search box. The first result is by Microsoft so select it and click install.

Now I created a Projects folder under my home, so click on open Folder in the File menu and select Projects. You can create individual folders for applications under that. If you look closely you can see Asteroids, AsteroidsDND and Examples with Asteroids being open and containing two .c files.

To compile, make sure the open tab is the file you wish to compile then click Terminal on the top menu and Run Build Task…¬† You’ll see the compiled programs on the left under the Asteroids folder (decnot and ex1).

There’s a bit more for configuring Builds and Debugging but I’ll cover that another time.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *