delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/30/09:38:07

From: Daniel Phillips <daniel AT biomed DOT gla DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Some problems with including structures in a library.
Date: Mon, 26 Jul 1999 10:37:46 +0100
Organization: University of Glasgow
Lines: 43
Message-ID: <379C2C6A.1756@yahoo.com>
NNTP-Posting-Host: d-cunningham.biomed.gla.ac.uk
Mime-Version: 1.0
X-Mailer: Mozilla 3.0 (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I have just started to use DJGPP to program in C and I am having some
problems.  I am now splitting my program into seperate files and I am
having some problems with the header file.

I define the structures like this in my C code:

struct spriteDef
{
 int x;
 int y;
 int imageNumber;
 int stillValid;
 };

struct spriteList
{
 struct spriteDef spriteDefParams[64];
 } spriteList;

and I define them in my header file like this:

extern struct spriteDef
{
 int x;
 int y;
 int imageNumber;
 int stillValid;
 };

extern struct spriteList
{
 struct spriteDef spriteDefParams[64];
} spriteList;

Every time I go to compile, I get told I have made an empty declaration,
but the problem is- I don't know how I should properly define the
structure.  Can anyone help me?

Sorry if the answer is really obvious, but I don't have much experience
of programming in C.

Thanks,
Dave Peterson.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019