Information Systems

ld versus gcc

I was having a problem with a Makefile in Linux.

I had a line something like:

ld filelist

to link a shared library. I would get all sorts of missing references at runtime, for instance fstat and fstat64 for large file support.

Finally, I switched to gcc for linking and it solved the problem.

LINK = gcc -shared

$(LINK) -o ../lib/ $(OBJECTS) $(LIBS)