You need to add -R<wherethelibraryis> to the link command line. E.g.,:
cc -L/usr/dt/lib -L/usr/openwin/lib \ -R/usr/dt/lib -R/usr/openwin/lib \ xprog.c -lXm -lXt -lX11
PREV INDEX NEXT