home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / amiga / programm / 11614 < prev    next >
Encoding:
Text File  |  1992-07-25  |  1.3 KB  |  52 lines

  1. Path: sparky!uunet!olivea!hal.com!darkstar.UCSC.EDU!cats.ucsc.edu!smythe
  2. From: smythe@cats.ucsc.edu (Brian Matthew Aljian)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Need help linking math library in makefile.
  5. Message-ID: <14q1dkINNob2@darkstar.UCSC.EDU>
  6. Date: 24 Jul 92 22:49:24 GMT
  7. Organization: University of California; Santa Cruz
  8. Lines: 41
  9. NNTP-Posting-Host: am.ucsc.edu
  10.  
  11.  
  12. I'm having a problem getting my floating point code to work when I use a
  13. makefile to compile/link it.  For example, here's a little program (call it
  14. "prog1.c"):
  15.  
  16.      void
  17.      main(void)
  18.      {
  19.         double    fp;
  20.  
  21.         fp = 66.99;
  22.         printf("Your number: %lf\n", fp);
  23.      }
  24.  
  25. I'm using SAS/C 5.10, and if I compile it with "lc -Lm prog1.c" everything
  26. works file and it prints out:
  27.  
  28. Your number: 66.99
  29.  
  30. But, if I use the following makefile to compile and link it (formatted to make
  31. it easier to read):
  32.  
  33.      prog1 : prog1.o
  34.         blink FROM lib:c.o+prog1.o TO prog1 LIB LIB:lc.lib+LIB:amiga.lib+
  35.                                             LIB:lcm.lib
  36.  
  37.      prog1.o : prog1.c
  38.         lc prog1.c
  39.  
  40. The program doesn't work and prints out:
  41.  
  42. Your number: %lf
  43.  
  44. Why isn't this working?  Aren't I including the math library with LIB:lcm.lib
  45. in the makefile above?
  46.  
  47. Any suggestions?  Thank you in advance.
  48.  
  49. -- 
  50.    Brian M. Aljian
  51.    smythe@stallion.santa-cruz.ca.us
  52.