[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Can't link libtiff.a static



Hello,

I want to debug a program of mine using dmalloc.  For that purpose
I wanted to link all libs statically.
I tried to reduce my problem to a simple one and wrote a simple
Makefile that compiles tiffinfo from the libtiff package.

Here is this Makefile
----------------------------------8<-----------------------------------
# makefile for tiffinfo
LIBDMALLOC=-static

NAME = tiffinfo

LIBS=$(LIBDMALLOC) -ltiff 
OBJS=$(NAME).o     

CFLAGS=$(DMALLOC)

.SUFFIXES: .c .o

.c.o:
	$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $< $(ERROR)

default: $(NAME)

$(NAME): $(OBJS)
	$(CC)  -o $@ $(OBJS) $(LDFLAGS) $(LIBS) 

$(NAME).o:     $(NAME).c

clean:
	rm -f *.o core $(NAME) *~ *.x *.a

--------------------------------->8-----------------------------------


If you comment out the line which defines LIBDMALLOC in the beginning,
which let ld do dynamically linking all works well.
But with the LIBDMALLOC define, which enforces statically linking
the libtiff functions were not found by the linker.

I'm relatively sure that this problem doesn't happen on my Hamm
system at home.  So I think something was happen in slink that
causes this trouble, but I can't imagine any reason.

Any help appreciated

         Andreas.


Reply to: