Comp 118: Object Oriented Programming

Installing CLion for Windows

Welcome

Welcome to Comp 118 Lab. This week is a little unusual in that we haven't really learned enough to start a typical lab. A typical lab session usually consists of a few demos, followed by a series of exercises on the content we have just seen in class. Sometimes, when necessary, we will also discuss the content of the coming programming assignment. While we do have a very short lab exercise for you this week, the focus of this lab session is downloading and installing the software we will need this semester.

Installation Instructions

This page contains the instructions to install the C++ compiler (as part of Cygwin) and the Integrated Development Environment - CLion - that we will use this semester.

The instructions here are for Windows users only. If you have a Mac, please go to this page.

Installing Cygwin

Cygwin provides a Linux-like environment for Windows users. We will only do a bare-bones installation of it since we will use it only for the C++ compiler it contains. Feel free to ask me if you would like to learn more about it and do a more complete installation.

First, you need the Setup executable, which you can get here. Execute it once you downloaded it. Once you are past the initial screen, select that you want to install cygwin from the internet:

Then, after selecting the install directory (where Cygwin will be on your computer) and local package directory (where all the downloaded files will initially go) of your choosing, when asked about the type of your internet connection, select "Direct Connection"

When asked for a download site,

feel free to pick any site you want, just make sure that you don't pick the same as your neighbors (please don't all pick the first one), otherwise downloading will be quite slow.

After that, you will be asked to select the packages you would like to install. This is where things get a little tricky. Initially, the setup program should have picked all the default options for a Cygwin install.

We just need to add a few packages to have the compiler and tools we need.
First, switch to the "Full" view for the packages:

We will need to add four packages. Follow the instructions on the following four images to get them. You can click on the images to make them bigger. You may also need to enlarge the window a bit to see the packages you need to install, I had to enlarge it a bit to get the images below. Pay close attention to the line that is selected in each screen.

IMPORTANT: for GDB, make sure that you select a version number that is at least 10, lower versions have caused problems to many students.

Once that's done, you can click "Next" and take the default option for all the following choices. This should start the installation of Cygwin.

Note that the setup program is sometimes a little fickle, and you may need to run it one or two more times to have everything we need installed. I'm not sure why. Maybe some packages sometimes need to be installed in a first round before other packages can be installed...

Creating an account on JetBrains

Click on this link to go to the JetBrains page and create a student account using your wheatoncollege.edu email address. You will need this account and your password to register CLion when you install it.

Installing CLion

Click on this link to go to the CLion download page, and download and install CLion. During the install, I recommend that you create a Desktop icon and you associate .c, .h, .cpp and .hpp files with CLion.

Once the install is completed, run CLion for the first time. There will be a number of options you need to select only the first time the IDE is run, like the choice of background (pick whichever you prefer, I will use the white one because it projects better in class), toolchain configuration (which compiler you will be using — it could take a couple minutes for CLion to detect Cygwin properly) and choice of plugins (you can choose the defaults). Finally, you will be asked to register your copy of CLion with the account you created earlier.

That's it, you are done! you are now ready to write programs using CLion. Once you reach this step, wait for the rest of the class to also reach this point and help your classmates to finish if you can. Once everyone is done, I will talk a bit about the small exercises you can do in C++.