* Help with sqrt() and #include <math.h> and what -l???
@ 2005-02-26 14:22 Ron Hudson
2005-02-27 0:24 ` Jonathan Wilson
0 siblings, 1 reply; 5+ messages in thread
From: Ron Hudson @ 2005-02-26 14:22 UTC (permalink / raw)
To: gcc-help
I want to use sqrt() in my C program, everything compiles but the linker
can't find sqrt()
/tmp/ccUBZv3v.o(.text+0xe36): undefined reference to 'sqrt'
I believe i need a -l<some library> in my makefile but I don't know
how to find out what <some library> is...
ron.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Help with sqrt() and #include <math.h> and what -l???
2005-02-26 14:22 Help with sqrt() and #include <math.h> and what -l??? Ron Hudson
@ 2005-02-27 0:24 ` Jonathan Wilson
2005-02-28 7:49 ` Ron Hudson
0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Wilson @ 2005-02-27 0:24 UTC (permalink / raw)
To: Ron Hudson; +Cc: gcc-help
Depends on the platform.
But, try -lm (to read libm.a) since that seems to be the "standard" on
things like linux and other unix platforms.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Help with sqrt() and #include <math.h> and what -l???
2005-02-27 0:24 ` Jonathan Wilson
@ 2005-02-28 7:49 ` Ron Hudson
2005-02-28 10:49 ` Jonathan Wilson
0 siblings, 1 reply; 5+ messages in thread
From: Ron Hudson @ 2005-02-28 7:49 UTC (permalink / raw)
To: gcc-help
-lm works, Thank you.
Now how can I answer that sort of question for myself in future... I
looked at the man page for
sqrt and gcc, but they didn't tell me anything.
On Feb 25, 2005, at 6:23 PM, Jonathan Wilson wrote:
> Depends on the platform.
> But, try -lm (to read libm.a) since that seems to be the "standard" on
> things like linux and other unix platforms.
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Help with sqrt() and #include <math.h> and what -l???
2005-02-28 7:49 ` Ron Hudson
@ 2005-02-28 10:49 ` Jonathan Wilson
2005-02-28 17:32 ` corey taylor
0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Wilson @ 2005-02-28 10:49 UTC (permalink / raw)
To: Ron Hudson; +Cc: gcc-help
Depends on what OS.
If its linux (or some other unix), the manpages for the function should
tell you.
If its something else (e.g. mac, windows, etc), I dont know.
But for all the math functions, use -lm
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Help with sqrt() and #include <math.h> and what -l???
2005-02-28 10:49 ` Jonathan Wilson
@ 2005-02-28 17:32 ` corey taylor
0 siblings, 0 replies; 5+ messages in thread
From: corey taylor @ 2005-02-28 17:32 UTC (permalink / raw)
To: Jonathan Wilson; +Cc: Ron Hudson, gcc-help
Ron,
http://www.linuxbase.org/spec/refspecs/LSB_1.2.0/gLSB/baselib.html
has a thorough matching.
http://www.linuxbase.org/spec/refspecs/LSB_1.2.0/gLSB/libm.html libm
interfaces specifically.
I offer this as suggestive information only.
corey
On Sat, 26 Feb 2005 10:45:27 +0800, Jonathan Wilson <jonwil@tpgi.com.au> wrote:
> Depends on what OS.
> If its linux (or some other unix), the manpages for the function should
> tell you.
> If its something else (e.g. mac, windows, etc), I dont know.
> But for all the math functions, use -lm
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-02-26 4:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-26 14:22 Help with sqrt() and #include <math.h> and what -l??? Ron Hudson
2005-02-27 0:24 ` Jonathan Wilson
2005-02-28 7:49 ` Ron Hudson
2005-02-28 10:49 ` Jonathan Wilson
2005-02-28 17:32 ` corey taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).