home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / linux / 25465 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.4 KB  |  43 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!hp9000.csc.cuhk.hk!a080700
  3. From: a080700@hp9000.csc.cuhk.hk (Stephen Wong S M)
  4. Subject: gcc 2.3.3 problem
  5. Message-ID: <1993Jan25.144702.4734@hp9000.csc.cuhk.hk>
  6. Organization: The Chinese University of Hong Kong
  7. Date: Mon, 25 Jan 1993 14:47:02 GMT
  8. Lines: 33
  9.  
  10. I'm using linux 0.99pl4/SLS 1.0/gcc 2.3.3/lib 4.2 and I test the
  11. gcc compiler with the following program:-
  12.  
  13. test_sqrt.c
  14. #include <math.h>
  15. #include <stdio.h>
  16. main()
  17. {   double a;
  18.     a = 2;
  19.     printf("square root of 2 is %f\n", sqrt(a));
  20. }
  21.  
  22. I use the following command line to compile:-
  23. gcc -lm -o test_sqrt test_sqrt.c
  24.  
  25. but I got the following error message:-
  26. /usr/tmp/cca001331.o: Undefined symbot _sqrt referenced from text segment
  27.  
  28. Then I tried another command line:-
  29. gcc -o test_sqrt test_sqrt.c /usr/lib/libm.a
  30.  
  31. and succeed.
  32.  
  33. My question is, is it a bug in gcc 2.3.3/lib 4.2 (libm.a), or something
  34. I misunderstand?
  35.  
  36. *><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*
  37. v Stephen Wong Siu-ming       v internet: stephenwong@cuhk.hk        v
  38. ^ Computer Services Center    ^ bitnet  : a080700@cucsc.bitnet       ^
  39. * Chinese University of       * phone   : (852) 609-8904             *
  40. v Hong Kong                   v fax     : (852) 603-5001             v
  41. *><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*
  42.  
  43.