Skip to content

Latest commit

 

History

History
107 lines (55 loc) · 3.34 KB

labpack-howto.md

File metadata and controls

107 lines (55 loc) · 3.34 KB

Table of Contents

Download the labpack

Click here to find the labpack on sharepoint; you may have to enter your ID and password.

Click “download the entire zip file”.

img

Save the file.

img

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:

img

Extract the zip file using 7zip

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”):

img

It will take about 5 minutes to unzip.

Using the labpack

Open the labpack:

img

Double-click on the “lab1” .bat file to launch VSCode:

img

(If it says you can’t open it, click “more info”, then say “open anyway”.)

Accept the trust settings:

img

Compiling “Hello, world!”

Double click on “main.c” to see the code for “Hello, world!”.

From the top menu, choose “Start Debugging” from the “Run” category:

img

Choose “C++ (GDB/LLDB)”:

img

Choose “gcc”:

img

After a while, you should see a menu on the bottom half of VSCode. Select “TERMINAL” to see the output of the program:

img

Compiling from the terminal

Type “ls” (letter l, not number 1) in the terminal and hit “enter”:

img

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.

img