[Bug 878313] Re: undefined reference to `ceil' / floor / pow

frankster 878313 at bugs.launchpad.net
Wed Oct 19 16:19:48 UTC 2011


-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/878313

Title:
  undefined reference to `ceil' / floor / pow

Status in “gcc-defaults” package in Ubuntu:
  New

Bug description:
  The math libraries do not get linked correctly in ubuntu 11.10. I
  include the -lm command but the linker doesn't find the math
  libraries.

  frankster at frankie-laptop:~/wms/support> cat testm.c
  #include <math.h>

  int main(int argc, char*argv[]){
    double x;
    double return_val = ceil(x);
    return 0;
  }
  frankster at frankie-laptop:~/wms/support> gcc -lm testm.c
  /home/frankster/wms/work/tmp/ccNkQLo6.o: In function `main':
  testm.c:(.text+0x15): undefined reference to `ceil'
  collect2: ld returned 1 exit status

  The libraries exist here (not sure if this is the correct place or not):
  frankster at frankie-laptop:~/wms/support> find /usr/lib -name libm.* 
  /usr/lib/x86_64-linux-gnu/libm.a
  /usr/lib/x86_64-linux-gnu/libm.so

  ProblemType: Bug
  DistroRelease: Ubuntu 11.10
  Package: gcc 4:4.6.1-2ubuntu5
  ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
  Uname: Linux 3.0.0-12-generic x86_64
  ApportVersion: 1.23-0ubuntu3
  Architecture: amd64
  Date: Wed Oct 19 17:16:07 2011
  InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
  ProcEnviron:
   LANGUAGE=en_GB:en
   PATH=(custom, user)
   LANG=en_GB
   SHELL=/bin/bash
  SourcePackage: gcc-defaults
  UpgradeStatus: Upgraded to oneiric on 2011-10-14 (5 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/878313/+subscriptions




More information about the foundations-bugs mailing list