C++ Installation Choices for Your Operating System |
Depending on the native operating system for your computer, you have several different options for C++ development with GNU g++ or LLVM clang++. More information on each choice is below and on other pages.
Windows 10
- Windows Subsystem for Linux (WSL) Recommended
- g++ or clang++ with Ubuntu/other GNU/Linux in VirtualBox
MacOSX
- clang++ in the Terminal or XCode IDE
- g++ or clang++ with Ubuntu/other GNU/Linux in VirtualBox
Note: The memory debugging software has not yet be updated to run on the Mac M1/M2 ARM processors.
GNU/Linux
- g++ or clang++
NOTE: It is possible to run a true dual-boot on Windows or Mac by partitioning your hard drive and installing a GNU/Linux distribution there, but it requires a more complicated setup. Only do this if you really know what you're doing. Instructions exist online for how to do this, but it is possible to brick your machine this way and course staff won't necessarily be able to help you with any issues you encounter.
MacOSX XCode
If you're using a Mac, you'll need to install XCode, which is a free download from the Apple App store. XCode provides both a C++ compiler (technically the LLVM clang++ compiler) and an integrated development environment (IDE) similar to Microsoft's Visual Studio.
Make sure to install XCode's "Command Line Tools" so that you can run the compiler from the Terminal command line. NOTE: Even if you plan to use the XCode IDE for the bulk of your development & testing, in lab & office hours we will usually ask you to demo your program from the Terminal command line.
Ubuntu in VirtualBox
Here are some install instructions on installing Ubuntu in VirtualBox. If you want a different operating system, you can generally use the same instructions and just substitute the OS image you have for the Ubuntu one referenced in the instructions.
- Windows: http://www.psychocats.net/ubuntu/virtualbox
- Mac: http://www.simplehelp.net/2015/06/09/how-to-install-ubuntu-on-your-mac/
g++ or clang++ on Ubuntu:
Installing g++ or clang++ on Ubuntu (and many other GNU/Linux variants) is as simple as running the following commands in a terminal:
sudo apt-get install g++ gdb sudo apt-get install clang-10 lldb sudo apt-get install gcc-multilib g++-multilib
Be sure to click through the other pages linked in the upper right menu.