Yes I know there are threads on this but ive viewed multiple ones and i just don't get it. This is my first time operating with things like this and my teacher didn't even explain it to us so im lost.
Basically I have a program, but all of my references to the stuff in the given .h files give a linker error.
For example,
in externs.h there is a segment of declarations like this:
Code:
extern int Agent; ///< Current user
extern event_type Event; ///< Current event
extern char* Op_Names[]; ///< Table of operator names
extern char* Event_Names[]; ///< Table of event names
extern char* Prog_Names[]; ///< Program file pointers
extern char* Prog_File_Names[]; ///< Name of program files
extern int Num_Devices; ///< Number of devices
extern int Num_Terminals; ///< Number of user terminals
Now I need to use these things in my obj1.c which has
#include "externs.h"
(amongst others)
Code:
void
Interrupt( )
{
//Pointer to the head of the list.
event_list *head;
head = Event_List;
//Setting Clock, Agent, and Event to their respective fields
Agent = head->agent;
Event = head->event;
Clock = head->time;
//other code unimportant to the question im asking.
}
and everything i reference from externs.h gives me a linker error. Is there a step I'm missing? Do I need to do something with the files to make them correctly link? Once again sorry for creating a new thread but I couldn't get it from what i saw online so i had to ask for help on my specific case.