Math function error

Math function error

Post by AMADIU » Wed, 02 Jul 2003 06:59:44



Hello,
I get this error every time I a try to compile a program with math
functions.

ld: 0711-317 ERROR: Undefined symbol: .pow
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
collect2: ld returned 8 exit status

Any help would be appreciated.

--
Amadou O. Wane
Online Faculty
University of Phoenix
Tampa, FL
(813) 814-4234 [Eastern Time Zone]


 
 
 

Math function error

Post by Fletcher Glen » Wed, 02 Jul 2003 07:11:16



> Hello,
> I get this error every time I a try to compile a program with math
> functions.

> ld: 0711-317 ERROR: Undefined symbol: .pow
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information.
> collect2: ld returned 8 exit status

> Any help would be appreciated.

> --
> Amadou O. Wane
> Online Faculty
> University of Phoenix
> Tampa, FL
> (813) 814-4234 [Eastern Time Zone]



Try adding "-lm" to the end of your compile line.
This will cause the math library (libmath) to be
included in your compile.

--
                Fletcher Glenn


 
 
 

Math function error

Post by Fletcher Glen » Wed, 02 Jul 2003 07:13:41




> > Hello,
> > I get this error every time I a try to compile a program with math
> > functions.

> > ld: 0711-317 ERROR: Undefined symbol: .pow
> > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> > information.
> > collect2: ld returned 8 exit status

> > Any help would be appreciated.

> > --
> > Amadou O. Wane
> > Online Faculty
> > University of Phoenix
> > Tampa, FL
> > (813) 814-4234 [Eastern Time Zone]


> Try adding "-lm" to the end of your compile line.
> This will cause the math library (libmath) to be
> included in your compile.

> --
>                 Fletcher Glenn


Pardon me, instead of libmath I should have said libm.

--
                Fletcher Glenn

 
 
 

Math function error

Post by David Schwart » Wed, 02 Jul 2003 08:19:05



Quote:> Hello,
> I get this error every time I a try to compile a program with math
> functions.
> ld: 0711-317 ERROR: Undefined symbol: .pow
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information.
> collect2: ld returned 8 exit status

    Whenever the linker gives you an undefined symbol error, you should
search all your system libraries to see which one provides that symbol. Odds
are, you'll find it in libm, so add '-lm' to your final step.

    DS

 
 
 

1. GCC gives error on any math.h defined functions

I tried compiling the following program and GCC will definitely give an
error message on any calls to functions that are defined in <math.h>.  I
don't understand why.  I was just testing out GCC when I encountered
this.  The code is as below:

#include <math.h>
#include <stdio.h>

void main (void)
{
  int i;
  double j;

  printf ("\nHello World!");

  i = 1;

  /* can put in any <math.h> calls here */
  j = sin(i);

  printf ("\n%lf", j);

Can anyone please help?  Thanks a lot.

Regards,
C. J. Tan
------------------------------------------------------------------------------
C. J. Tan


URL: http://www.cuug.ab.ca/~tanc        Facsimile: 1-403-244-4123

    "A working program without comments is a time bomb waiting to explode."
                   --- Steve Oualline
------------------------------------------------------------------------------

2. gdb corefile debug problem: not in exe format

3. BSD math library function equivs in Solris 2.2

4. Second Bayonne Milestone released (GNU Telephony Server)

5. GCC math functions not found

6. mapping PID to open port

7. why are the float math functions unimplemented or defined ?

8. Applix Office abandoned?

9. Looking for IEEE math functions

10. Math functions in STREAMS Modules/Drivers

11. Math functions

12. Help: compiler doesn't recognize math functions

13. Trouble finding C's math functions: log10(), sin, etc...