Setting up your C++ environment
CMPT 135 uses modern C++ in Linux/Unix, and you should try to set up Linux on your own computer. Please make the effort to get C++ running on your own computer. It might take a bit of work the first time, but it's something that all software developers should be able to do.
Using Windows
- Install WSL by following these steps.
- Download and install the VS Code text editor.
- Get VS Code working with WSL.
- In VS Code, install C++ plugins to make development easier.
- compile and run all C++ programs in the WSL terminal command-line in VS Code. Do not use VS Code's compiling tools.
- Install g++ and related tools by opening a WSL terminal in VS Code and following the instructions below.
Using MacOS
If you have a Mac, you can use the Terminal that comes with it and install the necessary software for this course (g++, make, and valgrind, as described below) using a package manager such as MacPorts or Homebrew.
Installing C++ Tools
In MacOS, you will use MacPorts or Homebrew to install the needed packages as described above.
In Linux or WSL, open a Linux terminal command-line and type this command:
$ sudo apt-get install g++ make valgrind
This makes sure these three important programs are installed:
g++is the compiler we're using in this course. It converts C++ source code files into executable programs.makeis a "build tool" that simplifies callingg++with the correct options.valgrindis a memory-checker that can tell you if your program has subtle errors such as memory leaks or dangling pointers.
You don't need to install these packages on CSIL lab computers; they should already be installed.
Other Options
- You can access the CSIL Linux machines remotely:
- Note: You must register for SFU Multi-Factor Authentication to access CSIL remotely
- How to access the CSIL Linux machines
- You can install Linux in a virtual machine on your computer:
- VirtualBox: Free virtual machine, runs under most OS's
- Ubuntu Linux: Download 64-bit ISO to run in Virtual Box
- Try running C++ on using a web-based environment like Github Codespaces or repl.it