From: Stephen Wong S M (a080700@hp9000.csc.cuhk.hk)
Date: 01/25/93


From: a080700@hp9000.csc.cuhk.hk (Stephen Wong S M)
Subject: gcc 2.3.3 problem
Date: Mon, 25 Jan 1993 14:47:02 GMT

I'm using linux 0.99pl4/SLS 1.0/gcc 2.3.3/lib 4.2 and I test the
gcc compiler with the following program:-

test_sqrt.c
#include <math.h>
#include <stdio.h>
main()
{ double a;
    a = 2;
    printf("square root of 2 is %f\n", sqrt(a));
}

I use the following command line to compile:-
gcc -lm -o test_sqrt test_sqrt.c

but I got the following error message:-
/usr/tmp/cca001331.o: Undefined symbot _sqrt referenced from text segment

Then I tried another command line:-
gcc -o test_sqrt test_sqrt.c /usr/lib/libm.a

and succeed.

My question is, is it a bug in gcc 2.3.3/lib 4.2 (libm.a), or something
I misunderstand?

*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*
v Stephen Wong Siu-ming v internet: stephenwong@cuhk.hk v
^ Computer Services Center ^ bitnet : a080700@cucsc.bitnet ^
* Chinese University of * phone : (852) 609-8904 *
v Hong Kong v fax : (852) 603-5001 v
*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*