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

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!gumby!smaug!smeagol!mcfall
  3. From: mcfall@cs.hope.edu (Ryan Mcfall)
  4. Subject: Re: gcc 2.3.3 problem
  5. Message-ID: <1993Jan28.154815.25761@cs.hope.edu>
  6. Sender: news@cs.hope.edu
  7. Reply-To: mcfall@cs.hope.edu
  8. Organization: Hope College
  9. References: <1993Jan25.144702.4734@hp9000.csc.cuhk.hk>
  10. Date: Thu, 28 Jan 1993 15:48:15 GMT
  11. Lines: 35
  12.  
  13. In article 4734@hp9000.csc.cuhk.hk, a080700@hp9000.csc.cuhk.hk (Stephen Wong S M) writes:
  14. > I'm using linux 0.99pl4/SLS 1.0/gcc 2.3.3/lib 4.2 and I test the
  15. > gcc compiler with the following program:-
  16. > test_sqrt.c
  17. > #include <math.h>
  18. > #include <stdio.h>
  19. > main()
  20. > {   double a;
  21. >     a = 2;
  22. >     printf("square root of 2 is %f\n", sqrt(a));
  23. > }
  24. > I use the following command line to compile:-
  25. > gcc -lm -o test_sqrt test_sqrt.c
  26. > but I got the following error message:-
  27. > /usr/tmp/cca001331.o: Undefined symbot _sqrt referenced from text segment
  28. > Then I tried another command line:-
  29. > gcc -o test_sqrt test_sqrt.c /usr/lib/libm.a
  30. > and succeed.
  31. > My question is, is it a bug in gcc 2.3.3/lib 4.2 (libm.a), or something
  32. > I misunderstand?
  33.  
  34. I've run into the same problems when trying to link in other libraries.  
  35. gcc 2.3.3/lib 4.2 does not seem to be able to find the files unless you give
  36. it a full pathname.  Including the -L/usr/lib options does not help either.
  37.  
  38. Ryan McFall
  39. mcfall@cs.hope.edu
  40.  
  41.