Undefined reference error

From: Solar^ (nospam_at_nosapm.com)
Date: 08/22/04


Date: Sat, 21 Aug 2004 17:55:30 -0700

Trying to compile a program using GCC and written in C. I have a call to the
"sqrt" function and I keep getting an "undefined reference" error even
though the #include <math.h> is stated. Have installed all of the C
development tools as well as available libraries. Any suggestions would be
appreciated. Using SuSE 9.1 Professional.
TIA
Solar^

-- 
t'nod yrt siht ta emoh


Relevant Pages

  • Possible GCC problem
    ... This isn't exactly strictly Red Hat related, but since I get all my GCC ... I commented the array statement out and tried to compile it. ... Here is my program code for ... : undefined reference to `std::basic_ostream<char, ...
    (RedHat)
  • Re: Compiling flops.c
    ... I am trying to compile flops.c on my Debian system. ... flops.c:: undefined reference to `dtime' ... I also tried compiling it on a Solaris system with gcc 3.4 and had no ...
    (Debian-User)
  • Compiling flops.c
    ... I am trying to compile flops.c on my Debian system. ... flops.c:: undefined reference to `dtime' ... I also tried compiling it on a Solaris system with gcc 3.4 and had no luck. ...
    (Debian-User)
  • question about static variables
    ... I have this following class, but when I compile it, gcc shows a error ... message "undefined reference to `Animal::theNumberOfAnimals`". ... static int theNumberOfAnimals; ...
    (comp.lang.cpp)
  • Re: math.h problem -> sqrt undefined
    ... > When I compile I get undefined reference to 'sqrt' ... gcc -c foo ... You have to include the math library (for the reference to the sqrt ... abs() works without linking against libm because its provided by libc ...
    (comp.unix.bsd.freebsd.misc)