TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [TCLUG:222] linux libraries



math.h holds only the prototype for sin() but the actual definition is
in the math library (libm.so) which by default is available to the
linker at the link time on most systems but not in RH (I got RH4.2 and
have the same problem). Use -lm to link it and it should be OK.

Nishi

> -----Original Message-----
> From:	W. Kent Treichel [SMTP:mapman@visi.com]
> Sent:	Wednesday, May 20, 1998 8:51 AM
> To:	tclug-list@listserv.real-time.com
> Subject:	[TCLUG:222] linux libraries
> 
> This is not exactly a Linux question, but maybe someone has an answer.
> 
> I have a C program I tried to compile on my Linux box, RH 5.0.  My
> level
> of proficiency in either C or Linux/Unix is rudimentary at best.  I
> did
> not write the program but I thought I could figure out how to compile
> it, it seemed rather straightforward.  After attempting to compile the
> program, I received a list of errors.  I wasn't shocked and I think I
> understood most of it.  The errors stated that it couldn't find or use
> a
> variety of math operators, sin, cos, sqrt, acos, and pow.  I looked
> through the program and found the formulas, then I found math.h on the
> system and it was there.  it seems for some reason that it doesn't
> like
> the Linux math.h or maybe not.  This program did compile using cc on a
> sun Unix machine.  Incidentally, I also tried compiling on our AIX
> machine and received the same errors.  Thank you for your time and
> consideration.
> -- 
> W. Kent Treichel
> Wilder Research Center
> 1295 Bandana Blvd N. Suite 210
> St. Paul, MN  55108
> (612) 647-4636
> ______________________________
>  
> 1. Always look before you turn.
> 2. Turn right to avoid collisions.
> 3. Lower jumper has the right of way.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@listserv.real-time.com
> For additional commands, e-mail:
> tclug-list-help@listserv.real-time.com
> Try our website: http://tclug.real-time.com