Re: Array of Structures Initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kevin Stedman wrote:
Hello All,

Can someone give me an idea on how to figure out what
is going on with my initialization of an array of
structures.  This code compiles on Sun using the Sun
One studio CC compiler.  I am porting it to lnux and
have never seen this problem before.  Code examples of
what I am trying to compile are below.  Everything is
in the C header file.  When I compile I do not have
any gcc flags except for -g -c -o.  I get error
messages: "initializer element is not constant" and
"incompatible types in initialization" on every line
of the initialization of the array of structures
below.

#define INTEGER4 4
#define REAL8 8
#define STRING 9

typedef union{
	double RealX8;
	long IntX4;
	char *Str;
} InputValue;

typedef struct _Arguments{
	int keyword;			
	char *prompt_string;		
	char *default_string;		
	int type;			
        InputValue default_value;	
} Arguments;

Arguments SortLightningArgs[]={
	{Title, "NLDN Sort Routine (US
only)",NULL,INTEGER4,NULL},
	{UserDefined,"Minimum propagation
delay",".001",REAL8,NULL},
	{UserDefined,"Maximum propagation
delay","1.0",REAL8,NULL},
	{UserDefined,"Minimum latitude","20.0", REAL8,NULL},
	{UserDefined,"Maximum latitude","50.0", REAL8,NULL},
	{UserDefined,"Minimum longitude","-50.0",
REAL8,NULL},
	{UserDefined,"Maximum longitude","-150.0",
REAL8,NULL},
	{UserDefined,"Input file containing NLDN event
times","lightning.times.251_253", STRING,NULL},
	{UserDefined,"Output file containing list of time
differences and intensities",
                   "HistoTimeDifs.txt", STRING,NULL},
	{NULL,NULL,NULL,NULL,NULL}
};


I assume you want to define Title, UserDefined somewhere ? Also you might like to include stdio.h for NULL ?

cheers
ramana

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux