[gameprogrammer] C-Code Error interpretation

Sorry to bother, but I'm trying to get some code compiling so I can start working with it, but I'm running into some errors (two left now, actually) that I don't understand how to resolve.

First off, there's "static declaration of 'variable_name' follows non- static declaration", and then it links back to both places it's declared:

*.h -- extern int variable_name;
*.c -- static int variable_name;

I understand what it's SAYING, but I have no clue how to HANDLE it, how to address, remedy the situation.

The second error is as follows:  "conflicting types for FunctionName"

Simlarly the two versions look like this:

*.h -- returnType FunctionName(struct myStruct *var1, ...);
*.c -- returnType FunctionName(myType *var1, ...) {...}

So I UNDERSTAND this error, too, but I don't know how to fix it for two reasons:

1) the code compiles and runs under Windows as is (I've removed all the OS-specific stuff, and am simply compiling the main game part without that first).

2) here's the type definition for "myType" (generally -- I've abstracted the names a bit for simplicity's sake):

typedef struct myStruct {
...
} myType;

so in THEORY it looks to me like they should be the same thing, and thus work correctly as is... Anyhow, I don't know how to address this or the other problem, so anyone with experience, it would be GREAT if you could help me out with this! ^_^

Thanks,
--Scott


--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: