You are not logged in.

#1 2004-10-23 07:58:41

arthur_mueller
Member
From: Germany, RLP, Frankenthal
Registered: 2004-03-07
Posts: 18

ld finds no floor() function in glibc

Hi,

I'm currently trying to write a simple program in C for converting astronomy coordinates. But during the compile time ld allways returns:

time.o(.text+0x963): In function `julian_date':
/home/user/astro/time.c:269: undefined reference to `floorf'
time.o(.text+0x980):/home/user/astro/time.c:269: undefined reference to `floor'
collect2: ld returned 1 exit status

if  I'm using floor() or any other function from <math.h> listed  here. ld also can't find ceil() , floorf()  and so on.

I've tried to repacman my glic, but without any result. ld returns the same error. Currenty I have glibc-2.3.2-3 installed.

Thanks


I'll sleep when I'm dead

PGP pubkey on keyserver.net

Offline

#2 2004-10-23 09:20:50

kpiche
Forum Fellow
From: Ottawa, ON, Canada
Registered: 2004-03-30
Posts: 246
Website

Re: ld finds no floor() function in glibc

Floor is in the libm library so you need to add the link option -lm to your gcc command.

Offline

#3 2004-10-23 20:21:41

arthur_mueller
Member
From: Germany, RLP, Frankenthal
Registered: 2004-03-07
Posts: 18

Re: ld finds no floor() function in glibc

Thanks wink


I'll sleep when I'm dead

PGP pubkey on keyserver.net

Offline

Board footer

Powered by FluxBB