I made a library with the files pila.h
and pila.c
. I compile the file pila.c
with gcc pila.c -c
and this library works fine. I have tested it.
Then I made another library. This library has the files pila_funciones_extra.h
and pila_funciones_extra.c
. In this library I need to include the first library. In the file pila_funciones_extra.h
I put the next line to include it:
#include "pila.h"
and in the file pila_funciones_extra.c
I put the next line:
#include "pila_funciones_extra.h"
as it has to be.
But when I try to compile the file pila_funciones_extra.c
the compiler doensn't recognize the inclusion of the library pila
. It says that the functions, structures, constants and macros that are defined in the library pila
haven't been defined.
I tried to compile it with gcc pila_funciones_extra.c -c
and gcc pila_funciones_extra.c -c pila.o
but it doesn't work.
I made sure that all the files are in the same folder.
I'm working on Ubuntu.
Can anyone tell me the right way to compile it?