Problem:
The compile works, link fails with
ld: Can't find library or mismatched ABI for -llibrt.so
Modified the LD_LIBRARY_PATH, but it still fails.
Resolution:
The default linker search path can be modified by using the LPATH environment variable.
This environment variable allows you to specify which directories ld should search. If LPATH is not set, ld searches the default directory /usr/lib. If LPATH is set, ld searches only the directories specified in LPATH; the default directories are not searched unless they are specified in LPATH.
If set, LPATH should contain a list of colon-separated directory path names ld should search
In this case LPATH was set to /usr/lib.
Changed it to the /usr/lib/ hpux64 on the ia64 HP/UX server and the link works fine