Round Number

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marcos Jose Setim

    #1

    Round Number

    Hello,

    I need to round one number in language C, but I did not obtain. I
    already tried to use the:

    #include <math.h>

    ceil(value);

    But it's shown one error:

    marcos@zeus:~$ gcc quadradomagico. c
    /tmp/ccaZ4Pkk.o(.tex t+0x18d): In function `Gerar_Quadrado ':
    : undefined reference to `ceil'
    collect2: ld returned 1 exit status

    :'(

    Any Idea?

    Thank's

    Marcos
  • Paul Mesken

    #2
    Re: Round Number

    On Sun, 05 Jun 2005 07:43:22 -0300, Marcos Jose Setim
    <mjs_ops@gmx.ne t> wrote:
    [color=blue]
    >Hello,
    >
    >I need to round one number in language C, but I did not obtain. I
    >already tried to use the:
    >
    >#include <math.h>
    >
    >ceil(value);
    >
    >But it's shown one error:
    >
    >marcos@zeus: ~$ gcc quadradomagico. c
    >/tmp/ccaZ4Pkk.o(.tex t+0x18d): In function `Gerar_Quadrado ':
    >: undefined reference to `ceil'
    >collect2: ld returned 1 exit status
    >
    >:'(
    >
    >Any Idea?[/color]

    "Undefined reference" errors are typically caused by not linking with
    a required library (in this case the "math library").

    Use -lm to include it.

    Comment

    • Grumble

      #3
      Re: Round Number

      Marcos Jose Setim wrote:
      [color=blue]
      > marcos@zeus:~$ gcc quadradomagico. c
      > /tmp/ccaZ4Pkk.o(.tex t+0x18d): In function `Gerar_Quadrado ':
      > : undefined reference to `ceil'
      > collect2: ld returned 1 exit status[/color]

      $ gcc quadradomagico. c -lm

      Comment

      Working...