Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #24054

Re: floor()

From Noob <root@127.0.0.1>
Newsgroups comp.lang.c
Subject Re: floor()
Date 2012-08-01 16:47 +0200
Organization A noiseless patient Spider
Message-ID <jvbfgq$bjo$1@dont-email.me> (permalink)
References <5019226f$0$3111$ba620e4c@news.skynet.be>

Show all headers | View raw


Andre wrote:
> Trying to use floor in a short progrm, using gcc version 4.5.1
> 20100924 (Red Hat 4.5.1-4) (GCC) But compilation keep returning
> /tmp/cca35RWE.o: In function `main': testUTC.c:(.text+0xa8):
> undefined reference to `floor'

cf. comp.lang.c FAQ list
Question 14.3
http://c-faq.com/fp/libm.html

Q: I'm trying to do some simple trig, and I am #including <math.h>,
but the linker keeps complaining that functions like sin and cos are
undefined.

A: Make sure you're actually linking with the math library. For
instance, due to a longstanding bug in Unix and Linux systems, you
usually need to use an explicit -lm flag, at the end of the command
line, when compiling/linking.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

floor() Andre <pas.mois@ailleur.be> - 2012-08-01 14:34 +0200
  Re: floor() Xavier Roche <xroche@free.fr.NOSPAM.invalid> - 2012-08-01 14:38 +0200
    Re: floor() Andre <pas.mois@ailleur.be> - 2012-08-01 16:47 +0200
    Re: floor() Andre <pas.mois@ailleur.be> - 2012-08-01 17:49 +0200
      Re: floor() Ike Naar <ike@sverige.freeshell.org> - 2012-08-01 15:53 +0000
        Re: floor() falk@rahul.net (Edward A. Falk) - 2012-08-01 18:26 +0000
        Re: floor() Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-08-02 16:30 +0000
          Re: floor() Keith Thompson <kst-u@mib.org> - 2012-08-02 14:58 -0700
      Re: floor() "Heinrich Wolf" <invalid@invalid.invalid> - 2012-08-01 17:56 +0200
      Re: floor() Noob <root@127.0.0.1> - 2012-08-01 17:58 +0200
      Re: floor() Keith Thompson <kst-u@mib.org> - 2012-08-01 10:31 -0700
        Re: floor() Ben Pfaff <blp@cs.stanford.edu> - 2012-08-01 10:43 -0700
          Re: floor() James Kuyper <jameskuyper@verizon.net> - 2012-08-01 13:51 -0400
            Re: floor() Ben Pfaff <blp@cs.stanford.edu> - 2012-08-01 10:59 -0700
              Re: floor() Noob <root@127.0.0.1> - 2012-08-02 10:04 +0200
              Re: floor() Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-08-02 16:33 +0000
              Re: floor() Craig Franck <craiglfranck@gmail.com> - 2012-08-03 20:49 -0400
  Re: floor() Noob <root@127.0.0.1> - 2012-08-01 16:47 +0200
    Re: floor() Andre <pas.mois@ailleur.be> - 2012-08-01 16:48 +0200
  Re: floor() TheGunslinger <mikiesrunsbaal.sec@sbcglobal.net> - 2012-08-01 09:49 -0500
    Re: floor() Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-01 10:58 -0400
      Re: floor() TheGunslinger <mikiesrunsbaal.sec@sbcglobal.net> - 2012-08-01 10:02 -0500
        Re: floor() James Kuyper <jameskuyper@verizon.net> - 2012-08-01 11:10 -0400
        Re: floor() TheGunslinger <mikiesrunsbaal.sec@sbcglobal.net> - 2012-08-01 10:12 -0500
          Re: floor() pete <pfiland@mindspring.com> - 2012-08-01 12:04 -0400
          Re: floor() James Kuyper <jameskuyper@verizon.net> - 2012-08-01 12:04 -0400
          Re: floor() Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-01 13:07 -0400
          Re: floor() Craig Franck <craiglfranck@gmail.com> - 2012-08-03 21:11 -0400

csiph-web