Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling an HP-UX C source on AIX (math.h ?)

Status
Not open for further replies.

Zteev

Programmer
Jul 28, 2003
17
US
Hi people,

I'm trying to compile an older C program that has been coded for HP-UX at the time. Fortuately it uses the standard libraries but I still get some errors :

</home/shemond/code/spaut>$ cc v12_poly.c
ld: 0711-317 ERROR: Undefined symbol: .cos
ld: 0711-317 ERROR: Undefined symbol: .sin
ld: 0711-317 ERROR: Undefined symbol: .sqrt

I expect these errors are related to math.h? How to know anyway?

Any help is appreciated,

Thanks a lot,

Best regards,

Steve
 
Problem solved.

I was compiling simply like that :
cc target.c

But I needed to specify the math lib :
cc -lm target.c

But what is wrong with the math library? Why other libs doesn't act like that?

Thanks!
 
nothing wrong.

-lm indicates to compiler, loader:

scan {/usr}/lib/liblm* for functions like
cos(), sin() ...

:) guggach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top