Hello,
I'm writing a modular program. However, the compiler complains that it can't find the function create_list, but this function is declared in Bibliography.h
The precise error is:
kevin@kevin-N55SF:~/Desktop/Project$ gcc -Wall -ansi -pedantic -O0 -g -o Application Main.c/tmp/ccpYEJYU.o: In function `main':
/home/kevin/Desktop/Project/Main.c:21: undefined reference to `create_list'
collect2: ld returned 1 exit status
My Main.c:
Code:
/* AUTH: Kevin Strijbos
DATE: 26/02/2012
THIS IS THE MAIN FILE OF THE PROGRAM. */
#include "Bibliography.h"
int main (int argc, char *argv[])
{
FILE *fpntr;
REFERENCE *list; /* Head pointer for the linked list. */
list = NULL;
if ((fpntr = fopen(*(argv+1), "r")) == NULL) /* Open file. */
{
printf("Can't open file.\n");
return 1;
}
create_list(&list, fpntr); /* Create the linked list. */
return 0;
}
My bibliography.h:
Code:
/* AUTH: Kevin Strijbos
DATE: 26/02/2012
Contains the global declaration of BUFSIZE and function headers which work with the bibliography.
VER 1.0 */
#ifndef _BIBLIOGRAPHY_H_
#define _BIBLIOGRAPHY_H_
#include "Files.h"
#include "List.h"
#define BUFSIZE 512 /* Global declaration of bufsize, it has to be big since we don't know how long a reference is. */
void create_list (REFERENCE* *list, FILE *fpntr); /* Creates a linkd list of all references in the reference list. */
#endif
Anyone got an idea?
Thanks in advance!