title: undefined reference to `round' - why?? I'm using math.h
body: <p>I have a little problem with my source code. gcc speak to me:
  <em>undefined reference to `round'</em> but I don't know why because i'm using stdio.h, stdlib.h, math.h... :-( Can You help me with solve this problem?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;dirent.h&gt;
  #include &lt;math.h&gt;
  #include &lt;string.h&gt;
  #include &lt;dirent.h&gt;
  #include &lt;sys/stat.h&gt;
  #define VERYBIG 200
  
  int dir_size(const char* dirname)
  {
      int size = 0;
      char path[VERYBIG];
      struct stat tmp;
      DIR* cat = opendir(dirname);
      struct dirent* entry;
  
      while ((entry = readdir(cat)))
      {
          if (!((strcmp(entry-&gt;d_name, ".") == 0) || (strcmp(entry-&gt;d_name, "..") == 0)))
          {
              path[0] = 0;
              strcat(path, dirname);
              strcat(path, "/");
              strcat(path, entry-&gt;d_name);
              if (lstat(path, &amp;tmp) == -1)
                  perror("lstat");
  
              if (S_ISDIR(tmp.st_mode))
              {
                  size += round(tmp.st_blocks / 2);
                  size += dir_size(path);
              }
              else
              {
                  size += round(tmp.st_blocks / 2);
              }
          }
      }
      return size;
  }
  
  void rozmiar(int blocks, int h)
  {
      if (h == 0)
          printf("%d\t", blocks);
      else
      {
          double newbl;
          if (blocks &lt; 1024)
              printf("%dK\t", blocks);
          else if (blocks &lt; (1024 * 1024))
          {
              newbl = blocks / 1024;
              printf("%0.1fM\t", round(newbl));
          }
          else
          {
              newbl = blocks / (1024 * 1024);
              printf("%0.1fB\t", round(newbl));
          }
      }
  }
  
  void do_du(char dirname[], int s, int h)
  {
      DIR* kat;
      struct dirent* wpis;
      int sum = 0, dsize = 0;
      if ((kat = opendir(dirname)) == NULL)
          fprintf(stderr, "du2: cannot open %s\n", dirname);
      struct stat info;
      char path[VERYBIG];
  
      while ((wpis = readdir(kat)) != NULL)
      {
          if (!((strcmp(wpis-&gt;d_name, ".") == 0) || (strcmp(wpis-&gt;d_name, "..") == 0)))
          {
              path[0] = 0;
              strcat(path, dirname);
              strcat(path, "/");
              strcat(path, wpis-&gt;d_name);
  
              if (lstat(path, &amp;info) == -1)
                  perror("lstat");
  
              if (S_ISDIR(info.st_mode))
              {
                  dsize = dir_size(path) + round(info.st_blocks / 2);
                  sum += dsize;
                  if (s == 0)
                  {
                      rozmiar(dsize, h);
                      printf("%s\n", wpis-&gt;d_name);
                  }
              }
              else
              {
                  sum += round(info.st_blocks / 2);
                  if (s == 0)
                  {
                      rozmiar(round(info.st_blocks / 2), h);
                      printf("%s\n", wpis-&gt;d_name);
                  }
              }
          }
      }
      if (stat(dirname, &amp;info) == -1)
          perror("stat");
      sum += round(info.st_blocks / 2);
      rozmiar(sum, h);
      printf("%s\n", dirname);
  }
  
  int main(int ac, char* av[])
  {
      char optstring[] = "sh";
      int opcja, human = 0, suma = 0;
  
      while ((opcja = getopt(ac, av, optstring)) != -1)
      {
          switch (opcja)
          {
              case 's':
                  suma = 1;
                  break;
              case 'h':
                  human = 1;
                  break;
              case '?':
                  printf("Usage: du2 [-s] [-h] [KATALOG]\n\t-s\twyswietla wielkosc "
                         "katalogu\n\t-h\twysiwetla wielkosci plikow w kilo-/mega-/gigabajtach\n");
                  exit(1);
          }
      }
  
      if (human != 0 || suma != 0)
      {
          av++;
          ac--;
      }
  
      if (ac == 1)
          do_du(".", suma, human);
      else
          do_du(*++av, suma, human);
      return 0;
  }
  </code></pre>