What works on my system: removing -lXt placing -lXt after the -lXaw3d or -lXaw library
The way the linker works is this: it keeps a list of undefined references. Then it processes arguments in the order they are written. If it is an object file, it includes it in the build, adds all its references to the list and then deletes all those it defines. If it is a library (wich is an archived collection of object files) it runs through all the object files in the library in order, and includes those and only those that define a reference that is still undefined. So indeed, order matters, and in poorly constructed libraries even mentioning the same library twice can make a difference. Also the ordering of libraries and object files matters. If there is a good routine in libXaw and a bad one in libXt of the same name, the order of the libraries will decide which one is linked and which one is ignored. Putting in a library argment is only useful if there are other library arguments behind it that contain routines of the same name that you want to pre-empt. If leaving out the last library on the list does not cause any undefined references, it was truly unused. Linking through gcc likely passes some extra library arguments to ld that the user did not specify (like libc).
