home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / linux / 6597 < prev    next >
Encoding:
Text File  |  1992-07-23  |  1.4 KB  |  46 lines

  1. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!plains!grisanti@plains.NoDak.edu
  2. From: grisanti@plains.NoDak.edu (Ames Grisanti)
  3. Newsgroups: comp.os.linux
  4. Subject: Need help with math functions in GCC 2.2.2
  5. Message-ID: <19319@plains.NoDak.edu>
  6. Date: 24 Jul 92 05:28:35 GMT
  7. Article-I.D.: plains.19319
  8. Organization: University of North Dakota EERC
  9. Lines: 35
  10.  
  11. I can't get math functions to compile with GCC 2.2.2 running
  12. under linux 0.96a. I installed GCC according to the instructions
  13. and think it works since I was able to compile the kernel I'm
  14. running right now. But I was attempting to compile some programs
  15. of my own and couldn't get any math functions to work. For
  16. example the simple program:
  17.  
  18. #include <math.h>
  19.  
  20. void main(void)
  21. {
  22.     double x;
  23.  
  24.     for(x=0; x<=100; x++)
  25.     {
  26.         printf("%f %f\n",x, sin(x));
  27.     }
  28. }
  29.  
  30. Produces an error message complaining about undefined symbol
  31. _sin in segment main. I am compiling with the -lm flag. What is
  32. really strange about this is that I can compile the 0.96a kernel
  33. with this system just fine.
  34.  
  35. Any help is greatly appreciated.
  36.  
  37. Ames Grisanti
  38.  
  39. University of North Dakota
  40. Energy and Environmental Research Center
  41. [grisanti@plains.NoDak.edu      --         Internet]
  42. [grisanti@plains or ndsuvax     --         Bitnet  ]
  43. [uunet!plains!grisanti          --         UUCP    ]
  44. "Quantum Mechanics, the dreams that stuff is made of."
  45.     -unknown
  46.