home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!gatech!concert!sas!mozart.unx.sas.com!walker
- From: walker@twix.unx.sas.com (Doug Walker)
- Subject: Re: Precompiled Header Prob
- Originator: walker@twix.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <BtLE5u.1H6@unx.sas.com>
- Date: Wed, 26 Aug 1992 13:15:29 GMT
- References: <77867@ut-emx.uucp>
- Nntp-Posting-Host: twix.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 42
-
-
- In article <77867@ut-emx.uucp>, danbo@ccwf.cc.utexas.edu (Dan Higgins) writes:
- |> Gadget0 is in the precompiled header file (should be), so why
- |> can't I reference "extern struct Gadget Gadget0;" in my main module?
- |>
- |> Surely SOMEBODY uses precompiled header files...so tell me,
- |> what am I doing wrong this time?
-
- Sorry this took me a while to respond, I didn't see your posting the
- first time and only looked back for it when I saw a reply.
-
- You cannot define data or code in a precompiled header file.
- You can only declare it.
-
- Here's some examples of definitions:
-
- struct Gadget Gadget0;
- int func(int x, char *y);
-
- Here's some examples of declarations:
-
- extern struct Gadget Gadget0;
- int func(int x, char *y)
- {
- return(0);
- }
-
- If you are building a precompiled header file, the compiler
- automatically converts all definitions to declarations.
-
- You must define the data in a header file that is not included
- in the precompiled header or in your C source file.
-
- --
- *****
- =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
- *|. o.| || 1200/2400/9600 Dual
- | o |// For all you do, this bug's for you!
- ======
- usenet: walker@unx.sas.com bix: djwalker
- Any opinions expressed are mine, not those of SAS Institute, Inc.
-
-