UC3M

Telematic/Audiovisual Syst./Communication Syst. Engineering

Systems Architecture

September 2017 - January 2018

14.13.2.  Fixing compilation errors in C

Work Plan

  1. Open the document The compiler errors and warnings in which the most frequent compiler error messages are explained. Keep it handy to check while fixing the errors in the following programs.

  2. Download the file errors1.c and copy it into your work folder. Compile the program so that all errors and warning messages are shown. Store the error messages that appear in this first compilation.

    Search for the way to fix the errors and write down what you changed to fix each of them. Check the solution with the professor if required.

    What did you do for the error errors1.c:16: error: ‘M_PI’ undeclared (first use in this function) to disappear?

  3. Download the files errors2a.c, errors2b.c and errors2.h and copy them into another folder in your work space. Compile the program.

    As in the previous exercise, write down the changes to eliminate the errors and warnings. You may move definitions and/or declarations among the three files. Remember that if a function is not defined, it is possible that is part of a library. Check it using the man command.