Article View: gwu.seas
Article #2Re: help: gcc
From: Matthias Dittrich
Date: Mon, 11 Mar 1996 07:36
Date: Mon, 11 Mar 1996 07:36
52 lines
1918 bytes
1918 bytes
spiffy@seas.gwu.edu (Marc Goldberg) wrote:
>
>Trying to compile a program on Solaris 2.5, I've removed all bugs (syntax
>errors, at least) but these. Any help would be *greatly* appreciated.
>
>Thanks,
>--Marc
>
>~~~~~
>spiffy@felix:5: gcc 2FarmCheck.c
>2FarmCheck.c: In function `readHostFiles':
>2FarmCheck.c:23: dereferencing pointer to incomplete type
>2FarmCheck.c:25: dereferencing pointer to incomplete type
>2FarmCheck.c:27: warning: passing arg 3 of `fgets' from incompatible
> pointer type
>2FarmCheck.c: In function `main':
>2FarmCheck.c:66: storage size of `PID' isn't known
>~~~~~~
>
>The lines referred to are:
>
>char *readHostFiles(char *name)
> {
> int foo;
> struct FILE *fileDisc;
>
>(23) *fileDisc = fopen("/users/spiffy/urls.txt", O_RDONLY);
>
>(25) while (!feof(fileDisc))
> {
>(27) if ( fgets(name, HOSTNAMESIZE, fileDisc) != name)
> exit(12);
> }
> return name;
> }
>|
>|
>|
>int main(void)
> {
>(66) struct pid_t PID;
> char name[HOSTNAMESIZE]; /*Hostname of server to check on*/
>
> PID = getpid();
> ...other stuff...
> }
You have to include the header files which are defining the missung types and
functions. These should be stdio.h for file handling and sys/unistd.h for
getpid() and pid_t.
Good luck,
Matthias
Technical Details
Message-ID:
<4i0l50$js0@hpbblb.bbn.hp.com>Path:
arc1-ca.pugleaf.net!isonews.bbn.hp.com!hpbblb!newsReferences:
<4hpiht$1n2@cronkite.seas.gwu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!isonews.bbn.hp.com!hpbblb!news From: Matthias Dittrich <matti> Newsgroups: gwu.seas,comp.lang.c Subject: Re: help: gcc Date: 11 Mar 1996 07:36:00 GMT Organization: Hewlett-Packard Co. Message-ID: <4i0l50$js0@hpbblb.bbn.hp.com> References: <4hpiht$1n2@cronkite.seas.gwu.edu> NNTP-Posting-Host: trabant.bbn.hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712) X-URL: news:4hpiht$1n2@cronkite.seas.gwu.edu