home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / gnu / gcc / help / 1942 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  2.9 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!ucsbcsl!network.ucsd.edu!sdd.hp.com!cs.utexas.edu!sun-barr!decwrl!deccrl!bloom-beacon!eru.mt.luth.se!lunic!sunic!mcsun!Germany.EU.net!Informatik.Uni-Dortmund.DE!fred!maennig
  2. From: maennig@fred.informatik.uni-dortmund.de (Olaf Maennig)
  3. Newsgroups: gnu.gcc.help
  4. Subject: ??gcc with ansi and math lib??
  5. Message-ID: <16t9tvINN7se@fbi-news.Informatik.Uni-Dortmund.DE>
  6. Date: 19 Aug 92 11:05:35 GMT
  7. Sender: maennig@fred (Olaf Maennig)
  8. Organization: CS Department, Dortmund University, Germany
  9. Lines: 61
  10. NNTP-Posting-Host: fred
  11.  
  12. Hi, folks.
  13.  
  14. I'm fairly new to C compilers on Sun, so please no flames to my question. :-)
  15.  
  16. I've problems with gcc -ansi. When including math.h from my program vector.c,
  17. the following happens:
  18.  
  19. > make
  20. /usr/local/gcc-2.2.2/bin/gcc -g -Wall -ansi -c vector.c
  21. In file included from /usr/include/math.h:45, from vector.c:18:
  22. /usr/include/floatingpoint.h:101: field `rd' has incomplete type
  23. In file included from vector.c:18:
  24. /usr/include/math.h:197: parse error before `r_acos_'
  25. /usr/include/math.h:197: warning: data definition has no type or storage class
  26. /usr/include/math.h:198: parse error before `r_acosh_'
  27. /usr/include/math.h:198: warning: data definition has no type or storage class
  28. /usr/include/math.h:199: parse error before `r_acospi_'
  29. /usr/include/math.h:199: warning: data definition has no type or storage class
  30. .
  31. .
  32. .
  33. /usr/include/math.h:259: parse error before `r_y1_'
  34. /usr/include/math.h:259: warning: data definition has no type or storage class
  35. /usr/include/math.h:260: parse error before `r_yn_'
  36. /usr/include/math.h:260: warning: data definition has no type or storage class
  37. *** Error code 1
  38. make: Fatal error: Command failed for target `vector.o'
  39.  
  40. This happens with both versions 1.40 and 2.2.2 of gcc.
  41. When leaving '-ansi' away, it works as follows:
  42.  
  43. > make
  44. /usr/local/gcc-2.2.2/bin/gcc -g -Wall -c vector.c
  45. /usr/local/gcc-2.2.2/bin/gcc -g -Wall -c main.c
  46. /usr/local/gcc-2.2.2/bin/gcc -g -Wall -lm -lc -o prg vector.o main.o
  47. ld: Undefined symbol 
  48.    _sqrt 
  49. collect: /usr/bin/ld returned 2 exit status
  50. *** Error code 1
  51. make: Fatal error: Command failed for target `prg'
  52.  
  53.  
  54. What is going wrong? I don't achieve to get it working.
  55. Why does '-ansi' behave so that I cannot include math.h anymore?
  56. And why isn't it possible to use 'sqrt', although I have told to link the
  57. math library?
  58.  
  59. At my site, I cannot ask anyone, because they are all using 'cc'. Maybe I
  60. should have used that one, too :(, but I wanted to have ansi support.
  61. And now it's not working???
  62.  
  63. Fast help appreciated, because I have to work on my tool...
  64.  
  65. Thanx.
  66. -- 
  67.  
  68.  ---------------------------------------------------------------------------
  69.      _                   Department of Computer Science IV
  70.     / \     |\/|         University of Dortmund, Germany
  71.     \_/laf  |  |aennig   e-mail: maennig@siggi.informatik.uni-dortmund.de
  72.  ---------------------------------------------------------------------------
  73.