gulesh / cplusplus-beginners

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cplusplus-beginners

This is a fork of the Udemy beginner C++ course by John Purcell. This course covers most of the C++ programming concepts that will be used in CS312 (with the exception of the templates and the standard template library). We will review C++ in the first few weeks of class.

How to build

The Udemy course covers how to build using Eclipse. You're welcome to use any development environment you like. However, if you don't have a C++ development environment that you're already happy with, I will recommend the following for class.

Windows

We will use Microsoft's Visual Studio as our IDE (integrated development environment). Visual studio combines an editor and visual debugger.

Install Visual Studio

Download and install Visual Studio Community 2019.

Important!! During installation, select: Desktop development with C++

InstallOptions

Build

You will need to generate the solution file. Right click on the directory containing this repository and open Git Bash. Then execute the following commands

CMake

Inside Visual Studio, do the following to build:

  • From the menu, click "Build/Build Solution" to build every example.
  • Right click an example from the pane at the right (in the "Solution Explorer") to make it the current project.
  • To run from the menu, click "Debug/Start Debugging" to step through the code line by line.

For those of you new to Visual Studio, this video shows how to build, run, and debug.

macOS

On macOS, I recommend Visual Studio Code (VS Code) with clang as our C++ compiler and lldb as our C++ debugger.

Install Clang development tools

From terminal, run command xcode-select --install

  • You can follow the instructions here
  • A quick way to open terminal is to use spotlight. From the keyboard, type the <cmd> and <spacebar>. Then type terminal at the popup edit field.

With clang, you can already compile and build C++ programs. However, I'm going to recommend you install VS Code, which will make working with larger codebases easier.

Install VS Code

VS Code combines a terminal, editor window, and visual debugger together.

Quick tips for using terminal:

  • To build, you run the command clang++ <filename> in the terminal. This will generate an executable, called a.out
  • To run, type .\a.out in the VS Code terminal.

For those of you new to using terminal and VS Code, this video shows how to build, run, and debug on macOS.

About


Languages

Language:C++ 93.5%Language:CMake 5.3%Language:Rich Text Format 1.1%Language:C 0.1%