title: C round function is throwing error: "undefined reference to `round'..."
body: <p>I hope someone can help me. I am working through CS50x and am working on Pset1 - greedy. I am getting the following error whenever I compile my code:</p>
  
  <pre><code>/tmp/greedy-46be96.o: In function `main':
  greedy.c:(.text+0x95): undefined reference to `round'
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>Any help will be greatly appreciated. I apologise if the question is vague, I have tried to be in depth. I have used <em>man round</em> in the terminal, and have searched everywhere, trying different solutions, but nothing has worked.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;cs50.h&gt;
  #include &lt;math.h&gt;
  
  int main(void)
  {
      float owed;
      float change;
      float quarter = 0.25;
      float dime = 0.10;
      float nickel = 0.05;
      float penny = 0.01;
  
      do {
          printf("How much change is owed?: ");
          owed = GetFloat();
  
      } while(owed &lt;= 0);
  
      change = round(owed * 100);
  }
  </code></pre>
  
  <p>I am using this command to compile my code:</p>
  
  <pre><code>clang -o greedy greedy.c -lcs50
  </code></pre>