home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / programm / 12709 < prev    next >
Encoding:
Text File  |  1992-08-26  |  1.8 KB  |  56 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!gatech!concert!sas!mozart.unx.sas.com!walker
  3. From: walker@twix.unx.sas.com (Doug Walker)
  4. Subject: Re: Precompiled Header Prob
  5. Originator: walker@twix.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <BtLE5u.1H6@unx.sas.com>
  8. Date: Wed, 26 Aug 1992 13:15:29 GMT
  9. References:  <77867@ut-emx.uucp>
  10. Nntp-Posting-Host: twix.unx.sas.com
  11. Organization: SAS Institute Inc.
  12. Lines: 42
  13.  
  14.  
  15. In article <77867@ut-emx.uucp>, danbo@ccwf.cc.utexas.edu (Dan Higgins) writes:
  16. |> Gadget0 is in the precompiled header file (should be), so why
  17. |> can't I reference "extern struct Gadget Gadget0;" in my main module?
  18. |> 
  19. |> Surely SOMEBODY uses precompiled header files...so tell me,
  20. |> what am I doing wrong this time?
  21.  
  22. Sorry this took me a while to respond, I didn't see your posting the
  23. first time and only looked back for it when I saw a reply.
  24.  
  25. You cannot define data or code in a precompiled header file.
  26. You can only declare it.
  27.  
  28. Here's some examples of definitions:
  29.  
  30.    struct Gadget Gadget0;
  31.    int func(int x, char *y);
  32.  
  33. Here's some examples of declarations:
  34.  
  35.    extern struct Gadget Gadget0;
  36.    int func(int x, char *y)
  37.    {
  38.       return(0);
  39.    }
  40.  
  41. If you are building a precompiled header file, the compiler
  42. automatically converts all definitions to declarations.
  43.  
  44. You must define the data in a header file that is not included
  45. in the precompiled header or in your C source file.
  46.  
  47. -- 
  48.   *****
  49. =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
  50.  *|. o.| ||                                          1200/2400/9600 Dual
  51.   | o  |//     For all you do, this bug's for you!
  52.   ====== 
  53. usenet: walker@unx.sas.com                            bix: djwalker 
  54. Any opinions expressed are mine, not those of SAS Institute, Inc.
  55.  
  56.