Command Line Compiling

Much of the compiling for this course will be done via Makefiles in the Eclipse IDE. However, you will also need to learn how to compile and run C++ files from the Linux Terminal. This is generally quicker and simpler than having to set up an Eclipse project if you are working with just a couple of files.
The process will be explained in Lab 2, and is demonstrated in the video below.


Terminal Commands Used

Compile main.cpp to HelloWorld executable: g++ -Wall -o HelloWorld main.cpp
     g++: Use the Linux C++ compiler
     -Wall: Enables common warnings
     -o HelloWorld: Specifies the name of the compiled file
     main.cpp: The file to compile
Run the HelloWorld executable: ./HelloWorld

Creating a Makefile Project in Eclipse

The refresher lab and all assignments will require you to create a new makefile project with existing files.
Instructions for creating a new makefile project with existing files are detailed below and in the video.

     1) On Ubuntu, download and extract the zipped archive
     2) Open a new Eclipse window
     3) Go to File > New > Makefile Project with Existing Code
     4) Enter a project name
     5) Click Browse and go to the location of the extracted folder. Select the folder and click OK
     6) Select Linux GCC and then click Finish


Packaging Assignments for Submission

Assignments will be submitted via Canvas in a .zip compressed folder. The video below details how to obtain the necessary cover sheet, structure the folder, and compress. You will then need to navigate to the COMPSYS 202 / MECHENG 270 page on Canvas and submit under the Assignments heading.


COMPYSYS 202 / MECHENG 270
Department of Electrical and Computer Engineering
The University of Auckland 2017