Hi guys,
I have some problem to create a executable.
I have a program test.c (which contains the main() ). This includes one 1.h where is defined the prototype of some functions (which are given by 1.c), but also this 1.h includes other 2.h where C structures are given. This code is needed for 1.c (and other modules).
So, the gcc generates the object code without problems for 1.c ($gcc -I ../include -o 1.o -c 1.c). But when I try to generate the executable of test , I get undefined references problems. I try to create the executable as follows:
$ gcc -I ../include -o test test.o 1.o -lm
(In ../include are all .h)
This fail with undefined reference to the C structures given by 2.h.
Any idea?
I have some problem to create a executable.
I have a program test.c (which contains the main() ). This includes one 1.h where is defined the prototype of some functions (which are given by 1.c), but also this 1.h includes other 2.h where C structures are given. This code is needed for 1.c (and other modules).
So, the gcc generates the object code without problems for 1.c ($gcc -I ../include -o 1.o -c 1.c). But when I try to generate the executable of test , I get undefined references problems. I try to create the executable as follows:
$ gcc -I ../include -o test test.o 1.o -lm
(In ../include are all .h)
This fail with undefined reference to the C structures given by 2.h.
Any idea?