home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!hal.com!darkstar.UCSC.EDU!cats.ucsc.edu!smythe
- From: smythe@cats.ucsc.edu (Brian Matthew Aljian)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Need help linking math library in makefile.
- Message-ID: <14q1dkINNob2@darkstar.UCSC.EDU>
- Date: 24 Jul 92 22:49:24 GMT
- Organization: University of California; Santa Cruz
- Lines: 41
- NNTP-Posting-Host: am.ucsc.edu
-
-
- I'm having a problem getting my floating point code to work when I use a
- makefile to compile/link it. For example, here's a little program (call it
- "prog1.c"):
-
- void
- main(void)
- {
- double fp;
-
- fp = 66.99;
- printf("Your number: %lf\n", fp);
- }
-
- I'm using SAS/C 5.10, and if I compile it with "lc -Lm prog1.c" everything
- works file and it prints out:
-
- Your number: 66.99
-
- But, if I use the following makefile to compile and link it (formatted to make
- it easier to read):
-
- prog1 : prog1.o
- blink FROM lib:c.o+prog1.o TO prog1 LIB LIB:lc.lib+LIB:amiga.lib+
- LIB:lcm.lib
-
- prog1.o : prog1.c
- lc prog1.c
-
- The program doesn't work and prints out:
-
- Your number: %lf
-
- Why isn't this working? Aren't I including the math library with LIB:lcm.lib
- in the makefile above?
-
- Any suggestions? Thank you in advance.
-
- --
- Brian M. Aljian
- smythe@stallion.santa-cruz.ca.us
-