I have to solve something in C for school, but I'm stuck and I can't solve this problem.
I have this .c file where I call a function
Code:
lista = lista_criar(free);
The function "lista_criar" is defined in "listas.h" and "listas.c".
I have the include in the source file (#include "listas.h") and this header is in the same directory as the source, but when I try to compile i get this error:
Code:
cc -o prog main.o debug.o
main.o: In function `main':
/home/sparkt/PA/Ficha3/ex3/main.c:79: undefined reference to `lista_criar'
collect2: ld returned 1 exit status
make: *** [prog] Error 1
I also modified my makefile to this:
Code:
(...)
#Dependencies
main.o: main.c debug.h listas.h listas.c #${PROGRAM_OPT}.h
${PROGRAM_OPT}.o: ${PROGRAM_OPT}.c ${PROGRAM_OPT}.h
debug.o: debug.c debug.h
semaforos.o: semaforos.c semaforos.h
(...)
And still can't compile the code :s
Hope someone can help me figure out what I'm missing!
Thanks in advance!