- Table of Contents
- Download the labpack
- Extract the zip file using 7zip
- Using the labpack
- Compiling “Hello, world!”
- Compiling from the terminal
Click here to find the labpack on sharepoint; you may have to enter your ID and password.
Click “download the entire zip file”.
Save the file.
Wait until the download is complete before trying to open it. If it says “Download Failed”, click the circular arrow to restart the download.
Open the file in the file explorer:
7zip is a popular decompression tool and has been preinstalled on all lab computers. However, if you have not installed 7zip on your computer, you can download and install it here: https://www.7-zip.org/. You can use windows to decompress the labpack, but it will be slow.
Right click on the labpack and unzip it using 7zip (choose “Extract here”):
It will take about 5 minutes to unzip.
Open the labpack:
Double-click on the “lab1” .bat file to launch VSCode:
(If it says you can’t open it, click “more info”, then say “open anyway”.)
Accept the trust settings:
Double click on “main.c” to see the code for “Hello, world!”.
From the top menu, choose “Start Debugging” from the “Run” category:
Choose “C++ (GDB/LLDB)”:
Choose “gcc”:
After a while, you should see a menu on the bottom half of VSCode. Select “TERMINAL” to see the output of the program:
Type “ls” (letter l, not number 1) in the terminal and hit “enter”:
This shows files in the current directory (folder): main.c is the hello world program we compiled, and main.exe is the program that the compiler output.
To compile from the command line, type gcc main.c -o main.exe
in the terminal and hit enter.
To run the program, type ./main.exe
.