Hello, I work at the U.S. Department of Labor, on the Unemployment Insurance program. I am working on developing a new Benefit Financing model for the state of Oregon, and I am having an issue with passing a struct between mutiple .c and .cfn files( the .cfn files are for the C cursor screens). The srtuct in question foloews:
extern struct{
double x[6][30];
double xtxy[6][5];
double b[6];
double bstde[6];
double tval[6];
double bset[3][6];
double stats[6];
double ajrsq,ystde,ymse,xtra1,xtra2,syy;}regrs_;
The struct is declared first in the main .c module, bsyrhd.c, and is further defined in a .cfn called later, invxtx5.cfn. Compiling the screen gives me the error:
"invxtx5.cfn", line 15: identifier redeclared: regrs_
current : struct {array[6] of array[30] of double x, array[6] of array[5] of double xtxy, array[6] of double b, array[6] of double bstde, array[6] of double tval, array[3] of array[6] of double bset, array[6] of double stats, double ajrsq, double ystde, double ymse, double xtra1, double xtra2, double syy}
previous: struct {array[6] of array[30] of double x, array[6] of array[5] of double xtxy, array[6] of double b, array[6] of double bstde, array[6] of double tval, array[3] of array[6] of double bset, array[6] of double stats, double ajrsq, double ystde, double ymse, double xtra1, double xtra2, double syy} : "bsyrhd.c", line 40
It seems obvious that I should just remove the declaration of the struct from invxtx5.cfn. However, when I do that, iget this error:
Undefined first referenced
symbol in file
exp bsyrhd.o
log bsyrhd.o
pow bsyrhd.o
fabs bsyrhd.o
sqrt bsyrhd.o
regrs_ bsyrhd.o
My next thought was to remove the struct declaration from bsyrhd.c and put in back into invxtx5.cfn. When I do that, this is what happens:
"rgawb.cfn", line 52: undefined struct/union member: stats
"rgawb.cfn", line 52: warning: left operand of "." must be struct/union object
"rgawb.cfn", line 52: cannot dereference non-pointer type
"rgtxto.cfn", line 19: undefined symbol: regrs_
"rgtxto.cfn", line 19: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 19: cannot dereference non-pointer type
"rgtxto.cfn", line 19: cannot dereference non-pointer type
"rgtxto.cfn", line 20: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 20: cannot dereference non-pointer type
"rgtxto.cfn", line 20: cannot dereference non-pointer type
"rgtxto.cfn", line 21: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 21: cannot dereference non-pointer type
"rgtxto.cfn", line 21: cannot dereference non-pointer type
"rgtxto.cfn", line 22: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 22: cannot dereference non-pointer type
"rgtxto.cfn", line 22: cannot dereference non-pointer type
"rgtxto.cfn", line 27: undefined symbol: regrs_
"rgtxto.cfn", line 27: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 27: cannot dereference non-pointer type
"rgtxto.cfn", line 27: cannot dereference non-pointer type
"rgtxto.cfn", line 30: undefined symbol: regrs_
"rgtxto.cfn", line 30: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 30: cannot dereference non-pointer type
"rgtxto.cfn", line 30: cannot dereference non-pointer type
"rgtxto.cfn", line 31: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 31: cannot dereference non-pointer type
"rgtxto.cfn", line 31: cannot dereference non-pointer type
"rgtxto.cfn", line 39: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 39: cannot dereference non-pointer type
"rgtxto.cfn", line 39: cannot dereference non-pointer type
"rgtxto.cfn", line 39: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 39: cannot dereference non-pointer type
"rgtxto.cfn", line 39: cannot dereference non-pointer type
"rgtxto.cfn", line 40: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 40: cannot dereference non-pointer type
"rgtxto.cfn", line 40: cannot dereference non-pointer type
"rgtxto.cfn", line 40: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 40: cannot dereference non-pointer type
"rgtxto.cfn", line 40: cannot dereference non-pointer type
"rgtxto.cfn", line 58: undefined struct/union member: xtxy
"rgtxto.cfn", line 58: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 58: cannot dereference non-pointer type
"rgtxto.cfn", line 58: cannot dereference non-pointer type
"rgtxto.cfn", line 58: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 58: cannot dereference non-pointer type
"rgtxto.cfn", line 58: cannot dereference non-pointer type
"rgtxto.cfn", line 60: undefined struct/union member: bset
"rgtxto.cfn", line 60: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 60: cannot dereference non-pointer type
"rgtxto.cfn", line 60: cannot dereference non-pointer type
"rgtxto.cfn", line 66: undefined struct/union member: stats
"rgtxto.cfn", line 66: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 66: cannot dereference non-pointer type
"rgtxto.cfn", line 68: undefined struct/union member: stats
"rgtxto.cfn", line 68: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 68: cannot dereference non-pointer type
"rgtxto.cfn", line 69: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 69: cannot dereference non-pointer type
"rgtxto.cfn", line 73: undefined struct/union member: bset
"rgtxto.cfn", line 73: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 73: cannot dereference non-pointer type
"rgtxto.cfn", line 73: cannot dereference non-pointer type
"rgtxto.cfn", line 79: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 79: cannot dereference non-pointer type
"rgtxto.cfn", line 79: cannot dereference non-pointer type
"rgtxto.cfn", line 79: warning: left operand of "." must be struct/union object
"rgtxto.cfn", line 79: cannot dereference non-pointer type
"rgtxto.cfn", line 79: cannot dereference non-pointer type
"rgtur.cfn", line 13: undefined symbol: regrs_
"rgtur.cfn", line 13: warning: left operand of "." must be struct/union object
"rgtur.cfn", line 13: cannot dereference non-pointer type
"rgtur.cfn", line 13: cannot dereference non-pointer type
"rgtur.cfn", line 14: warning: left operand of "." must be struct/union object
"rgtur.cfn", line 14: cannot dereference non-pointer type
"rgtur.cfn", line 14: cannot dereference non-pointer type
"rgtur.cfn", line 15: warning: left operand of "." must be struct/union object
"rgtur.cfn", line 15: cannot dereference non-pointer type
"rgtur.cfn", line 15: cannot dereference non-pointer type
"rgtur.cfn", line 16: warning: left operand of "." must be struct/union object
"rgtur.cfn", line 16: cannot dereference non-pointer type
"rgtur.cfn", line 16: cannot dereference non-pointer type
"rgtur.cfn", line 30: undefined symbol: regrs_
Actually, there are more error messages than this, but the point is that none of the other cfns called by bsyrhd.c can find the struct without it being delacred in bsyrhd.c. My last try was to remove the extern part of the declaration from either the .c file or the .cfn file, but in both cases, I just received the redeclare error again. I do not know what to try next to resolve this issue. Any help with this problem is greatly appreciated.