I\'ve been pouring over this issue trying to figure out what is causing these errors, but so far I\'ve come up with nothing. I have this function:
struct tok
You have to declare struct matrix
outside a function prototype, like the error message implies.
You have in your scanner.h
header:
struct token scanToken(struct matrix refTable);
Since there's no prior declaration of struct matrix
in that header, or a header read before it is read, the struct matrix
is a new distinct type. It's also incomplete, so you really need to use a pointer to it.
You can fix it as simply as:
struct matrix;
struct token scanToken(struct matrix *refTable);
To be able to pass the struct matrix
by value instead of by pointer, you need a full definition of the structure, but pointers can be passed to incomplete types.
Or include the header that defines the struct matrix
fully in the scanner.h
header.
Note that you should protect your headers with multiple inclusion guards:
#ifndef SCANNER_H_INCLUDED
#define SCANNER_H_INCLUDED
…current contents…
#endif // SCANNER_H_INCLUDED
You might well add #include "otherheader.h"
in that one — the other header that defines struct matrix
in full.