home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3249 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.0 KB  |  65 lines

  1. Path: future.dreamscape.com!dgorton
  2. From: dgorton@future.dreamscape.com (David Gorton)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: I have a Linking Question, pleas HELP!
  5. Date: 9 Feb 1996 14:48:58 GMT
  6. Organization: Dreamscape Online
  7. Message-ID: <4ffmsq$r7f@saturn.dreamscape.com>
  8. NNTP-Posting-Host: future.dreamscape.com
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Hello, I have a question, I am new to C programming and I am 
  12. having a problem with SAS/C. First of all I can aready tell
  13. that SAS/C is quite powerful, compaired to the clone C compilers
  14. at school. The school is using Quick C and the book I am using
  15. needs a particular file for almost every program that we will
  16. be doing. The problem is I can't figure out how to use that file
  17. with the Amiga SAS/C program.
  18.  
  19. First let me give one of the programs, we are testing, and then 
  20. I will try and explain my problem has clearly has possible!
  21.  
  22.  
  23. /*
  24. File: add2f.c
  25. --------------
  26.  
  27. This program reads in two floating point numbers, adds them
  28. together, and prints their sum.
  29. */
  30.  
  31. #include <stdio.h>
  32. #include "genlib.h"
  33. #include "simpio.h"
  34.  
  35. main()
  36. {
  37.   double n1, n2, total;
  38.  
  39.   printf ("This program adds two floating-point numbers.\n");
  40.   printf("1st number? ");
  41.   n1 = GetReal();
  42.   printf("2nd number? ");
  43.   n2 = GetReal();
  44.   total = n1 + n2;
  45.   printf( "The total is %g\n", total);
  46.   }
  47.  
  48.  
  49.  
  50. OK this file has in it two non standard #include header files.
  51. In order to use them I have to like them to a file called
  52. roberts.lib.   AT school you must created a "mak" file. 
  53.  
  54. All I do is LINK it by setting the program list.
  55. example go into the File menu and hit L for List
  56. this brings up a screen that wants me to key in some info
  57. I then key in the MAK file name add2f.mak ENTER, and create it
  58. Then I key in the program name add2f.c ENTER and finally I would
  59. key in roberts.lib Enter and Save it.
  60.  
  61. My question is how can I get that .C program to use the roberts.lib
  62. for those undefined include files?    Thanks, hope someone can help
  63. I really rather be in from of my amiga doing most of the homework
  64. than one of the clones!
  65.