* compiling a C program under 4.0c
@ 1999-03-11 5:00 Stephen W. Hodge
1999-03-11 5:00 ` Jeff Sullivan
1999-03-11 5:00 ` Adam Price
0 siblings, 2 replies; 3+ messages in thread
From: Stephen W. Hodge @ 1999-03-11 5:00 UTC (permalink / raw)
I have some C programs that compiled fine under 3.2 of Digital Unix. When
we upgraded to 4.0c, they will no longer compile. I get the following error
message:
ld:
unresolved:
pow
sqrt
The #include <math.h> file is in the program (just as before). The listing
file shows they are there, but it will NOT compile.
My guess is that the actual binary objects are not loaded on the system.
Is there some product I have failed to load?
Thanks
Stephen
shodge@opus.freac.fsu.edu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: compiling a C program under 4.0c
1999-03-11 5:00 compiling a C program under 4.0c Stephen W. Hodge
@ 1999-03-11 5:00 ` Jeff Sullivan
1999-03-11 5:00 ` Adam Price
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Sullivan @ 1999-03-11 5:00 UTC (permalink / raw)
I believe that you need to link with the math library.
Add -lm to your compile command, as in the testcase below.
% cc t.c
ld:
Unresolved:
pow
sin
% cc t.c -lm
%
-Jeff
--
Jeff Sullivan | Compaq Computer Corp | mailto:jps@zk3.dec.com
DEC C and C++ | Nashua, NH ZK3-2/X29 | Jeff.Sullivan@compaq.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: compiling a C program under 4.0c
1999-03-11 5:00 compiling a C program under 4.0c Stephen W. Hodge
1999-03-11 5:00 ` Jeff Sullivan
@ 1999-03-11 5:00 ` Adam Price
1 sibling, 0 replies; 3+ messages in thread
From: Adam Price @ 1999-03-11 5:00 UTC (permalink / raw)
Stephen W. Hodge wrote in message <7c927r$kli$1@news.fsu.edu>...
>I have some C programs that compiled fine under 3.2 of Digital Unix. When
>we upgraded to 4.0c, they will no longer compile. I get the following error
>message:
>
>ld:
>unresolved:
>pow
>sqrt
>
>The #include <math.h> file is in the program (just as before). The listing
>file shows they are there, but it will NOT compile.
>
>My guess is that the actual binary objects are not loaded on the system.
>
>Is there some product I have failed to load?
>
>Thanks
>Stephen
>shodge@opus.freac.fsu.edu
>
>
These functions used to be in libc but now need to be loaded from libm.
add -lm to your link line to fix.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1999-03-11 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-11 5:00 compiling a C program under 4.0c Stephen W. Hodge
1999-03-11 5:00 ` Jeff Sullivan
1999-03-11 5:00 ` Adam Price
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox