public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc 2.95.3 linker problems
@ 2003-09-13 14:01 Jakob Bucher
  2003-09-13 14:31 ` Eljay Love-Jensen
  2003-09-13 15:03 ` Ishwar Rattan
  0 siblings, 2 replies; 4+ messages in thread
From: Jakob Bucher @ 2003-09-13 14:01 UTC (permalink / raw)
  To: GNU

Dear gcc-experts,

I´m using the gcc 2.95.3 compiler on a use linux 8.0 system.

Normal c-programs run fine. However when I use math-functions as "exp", or "log" the linker claims unresolved reference.
The math.h header has been included and the libc-devel been loaded using Yast2.

In the libc the math-functions appear not to be available.

My question is where to find the library of the math-functions and how to persuade the linker to use it.

Your advice will be highly appreciated.

Best regards

	Jakob Bucher 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gcc 2.95.3 linker problems
  2003-09-13 14:01 gcc 2.95.3 linker problems Jakob Bucher
@ 2003-09-13 14:31 ` Eljay Love-Jensen
  2003-09-13 15:03 ` Ishwar Rattan
  1 sibling, 0 replies; 4+ messages in thread
From: Eljay Love-Jensen @ 2003-09-13 14:31 UTC (permalink / raw)
  To: 320040615403-0001, GNU

Hi Jakob,

GCC does not normally include the math LIBRARY (libm.a or libm.so), even if you've included the math HEADER (math.h).  This practice is fairly common amonst compiler vendors, so GCC is not doing something wonky or strange.

You have to include the math LIBRARY by putting -lm (dash ell em) on your GCC link or compile+link line.

e.g.:
gcc -o myfoo foo.c -lm

HTH,
--Eljay


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gcc 2.95.3 linker problems
  2003-09-13 14:01 gcc 2.95.3 linker problems Jakob Bucher
  2003-09-13 14:31 ` Eljay Love-Jensen
@ 2003-09-13 15:03 ` Ishwar Rattan
  1 sibling, 0 replies; 4+ messages in thread
From: Ishwar Rattan @ 2003-09-13 15:03 UTC (permalink / raw)
  To: 320040615403-0001; +Cc: GNU

Try to include math-library with -lm option at the end of command-line

gcc prog.c -lm

-ishwar


On Sat, 13 Sep 2003, Jakob Bucher wrote:

> Dear gcc-experts,
>
> I´m using the gcc 2.95.3 compiler on a use linux 8.0 system.
>
> Normal c-programs run fine. However when I use math-functions as "exp", or "log" the linker claims unresolved reference.
> The math.h header has been included and the libc-devel been loaded using Yast2.
>
> In the libc the math-functions appear not to be available.
>
> My question is where to find the library of the math-functions and how to persuade the linker to use it.
>
> Your advice will be highly appreciated.
>
> Best regards
>
> 	Jakob Bucher
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* gcc 2.95.3 linker problems
@ 2003-08-22 19:54 Jakob Bucher
  0 siblings, 0 replies; 4+ messages in thread
From: Jakob Bucher @ 2003-08-22 19:54 UTC (permalink / raw)
  To: GNU-gcc

Dear gcc-experts,

I´m using the gcc 2.95.3 compiler on a
suse linux 8.0 system.

Normal c-programs run fine. However when I use math-functions
as "exp", or "log" the linker claims unresolved     external funktion.

Putting  -lm  into the command line, as recommended results in  "command not found".
On -l with the complete path of the libc.a library the linker claims not to find the dataset, which is definitely available.

Your advice will be highly appreciated.

Best regards

	J. Bucher 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-13 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-13 14:01 gcc 2.95.3 linker problems Jakob Bucher
2003-09-13 14:31 ` Eljay Love-Jensen
2003-09-13 15:03 ` Ishwar Rattan
  -- strict thread matches above, loose matches on Subject: below --
2003-08-22 19:54 Jakob Bucher

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).