Round Number

  • Thread starter Marcos Jose Setim
  • Start date
M

Marcos Jose Setim

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(.text+0x18d): In function `Gerar_Quadrado':
: undefined reference to `ceil'
collect2: ld returned 1 exit status

:'(

Any Idea?

Thank's

Marcos
 
P

Paul Mesken

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(.text+0x18d): In function `Gerar_Quadrado':
: undefined reference to `ceil'
collect2: ld returned 1 exit status

:'(

Any Idea?

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

Use -lm to include it.
 
G

Grumble

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

$ gcc quadradomagico.c -lm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top