Build a c++ program for linux or mac

broken image
broken image

In Figure 1, find terminal in the Spotlight results, and then click it to open a new Terminal windows (Figure 2).īefore starting, some basic knowledge you need to know is about unix-like system command-line commands. Download example code that was mentioned in the class. Here, we provide two cpp files, and one header file to you for demonstrating how you can run it on Mac.

broken image

Another way is using Xcode to new a project (i.e., a file with filename extension. One way is using g++ to compile and run programs in terminal (Recommended). We suggest you the following two ways to do that.

broken image

If you want to compile a C++ program that includes self-defined header files on Mac or other Linux environment. Using Commands in Terminal (Recommended)įor the course of NTU Programming Design, Spring 2014