There are many different compilers we can use to compile our code, and many different ways to use each compiler. For this course, I am VERY STRONGLY RECOMENDING that you use Microsoft’s compiler, called Microsoft Visual C++ (MSVC). This compiler can be downloaded alongside Visual Studio. Visit the Tutorial - Software Installation Guide to see how to download Visual Studio and MSVC.

Option 1: Visual Studio Terminal (HIGHLY PREFERED)

Before you start!

Compiling from the Visual Studio terminal is meant to work with Visual Studio’s “Open Folder” mode. If you open your “Solution Explorer” window and see a Solution and Project, then you have already gone too far. You need to backtrack to Starting a New Assignment/Lab.

Warning about the Terminal

The rest of this tutorial assumes you’re using a terminal INSIDE OF VISUAL STUDIO. This is NOT the same as using a terminal outside of Visual Studio. The section below describes how to open a terminal inside Visual Studio.

Option 2: Visual Studio Project/Solution (NOT PREFERED)

Pleaaaaaase don't do this!

Visual Studio’s Project/Solution setup can be very convenient for creating a program in C. However, these conveniences can hide the true process of how code is built, which is something we’re exploring in CS120. And if somehow the Project/Solution setup is altered in a weird way, it can be difficult to diagnose issues. Please only use the Project/Solution method of making C programs if you are VERY comfortable with Visual Studio and have prior programming experience.

Warning about MIDTERM/FINAL

Some questions on the midterm/final may ask about ways to compile/link using the terminal. Even if you choose to compile with the Project/Solution setup, YOU ARE STILL RESPONSIBLE FOR KNOWING ABOUT COMPILING/LINKING VIA THE TERMINAL, FOR THE MIDTERM/FINAL.

Compiling

I will be filling out this section later. For now, please use Option 1 above.


So you want to know more?