This is a problem I have in a piece of code I'm working on. Basically, I'm trying to compile my code and I keep getting the error: "Multiple Definition of "Top", pointed at my stack.c file (the one that contains the functions) with "first defined here" pointed at my main.c file. From reading the other questions with similar names, it seems to be something related to the includes. Here's the header file:
#ifndef STACK_H
#define STACK_H
#define MAXSIZE 10
struct stekas{
int content;
struct stekas *link;
}*top = NULL;
void push(void);
void pop(void);
void display(void);
void help(void);
#endif // STACK_H_INCLUDED
The stack.c and main.c files both have the exact same #includes and #defines:
#include <stdio.h>
#include <stdlib.h>
#include "stack.h"
#define MAXSIZE 10
Note that "top" is not once referred to in main.c. Again, if needed, I can post the entire code of the stack.c file if it's needed.