Friday, October 30

ld has unresolved functions in custom libraries

I ported some C code to a HPUX Itanium machine and built archive (.a) libraries with it. When I ran a makefile for test program it could not find any of the functions in the custom libraries although it could find them.

The solution is to put the object file (.o) before the libraries so the ld command has a list of functions to try and resolve in the libraries.

So instead of

ld -Llib -lcustom program.o


ld program.o -Llib -lcustom