struct X declared inside parameter list will not be visible outside of this definition or declaration
<p>This question has been asked before but non of the solution seemed to solve my problem.</p>

<p>I wrote a C library for college homework and wrote my own makefile for compiling.</p>

<p>**this is my first C code so I'm sorry if its a stupid question..</p>

<p>when I compile I get the following messages:</p>

<p>1.</p>

<p><code>warning: ‘struct stud’ declared inside parameter list will not be visible outside of this definition or declaration
 void addGrade(char *id, int courseId, int gradeToAdd, struct stud* students);</code></p>

<p>2.</p>

<pre><code>error: unknown type name ‘stud’
void addIncome(char *id, char *date, int amount, stud* students);
</code></pre>

<p>^^2 happened when I didn't declare "struct stud" but only "stud" inside a method even though I typedef'ed it. 1 happened when i used the word struct before declaration.</p>

<p>each .c file has a .h file with all the declaration of its methods.
each struct is defined  once in the right .h file and all the .c files includes student.h .</p>

<p>*I'm compiling with gcc in Linux environment. </p>

<p>I added my code and makefile:</p>

<p>includes inside main:</p>

<pre><code>#include&lt;stdio.h&gt;
#include&lt;string.h&gt;
#include&lt;stdlib.h&gt;
#include "grades.h"
#include "income.h"
#include "student.h"

main(){
    return 0;
}
</code></pre>

<p>student.h:</p>

<pre><code>#define MAX_STR_LEN 20
#define MAX_LIST_LEN 10
#define MAX_NUM_STUDENTS 30

typedef struct stud{
    char sId[MAX_STR_LEN];
    char sName[MAX_STR_LEN];
    struct grade* sGrades; //both head of the lists
    struct income* sIncome;
    int sGradeLen;
    int sIncomeLen;
}stud;
</code></pre>

<p>makefile: </p>

<pre><code>prog.o: main.o income.o grades.o student,o
    gcc -Wall main.o income.o grade.o student.o -o prog.o

main.o: ex2.c income.h grades.h student.h
    gcc -Wall -c ex2.c -o main.o

student.o: student.c student.h
    gcc -Wall -c student.c -o student.o

income.o: income.c income.h student.h
    gcc -Wall -c income.c -o income.o

grades.o: grades.c grades.h student.h
    gcc -Wall -c grades.c -o grades.o
</code></pre>

<p>I am not sure where my problem is and I will be grateful for help!</p>