makefiles
Hi,
I'm using a function which called from another lib ( I added it in the make file ) but I get an error msg : undefined reference to ' func name ' someone knows ???? |
How did you add the library? To LIBS?
Please give us the output of make immediately before the error (ie. the lines belonging to the last call of gcc). |
my make file :
LIBS = -L /usr/balbla/lib ..... mylib.a . . ar rc libmngr.a $(OBJS) $(LIBS) the ... are for many other libs + building objs |
In C, the header file contains the header of the function, the lib file or object file contains the whole functions. So you should include the header and add some thing like this in Makefile:
all exe header.h source.c hcc -o exe source.c |
I don't understand -- are you trying to build a binary? Or a library? Did you write mylib.a and now you are having problems linking it to a binary you are compiling?
With regards to: Code:
ar rc libmngr.a $(OBJS) $(LIBS) Code:
ar rc libmngr.a object1.o object2.o library3.a Code:
cp library3.a libmngr.a Code:
ar x library3.a |
are you calling one lib function from another lib?
if so: are you linking in the right order? it makes a difference in which order you link your libraries. |
All times are GMT -5. The time now is 04:07 AM. |