Some versions of "ld" support the "-Llibpath" option to specify an additional directory to search for libraries. You can always just name the library in the "ld" or "cc" command: cc -o myprog myprog.o mysub.o mylib.a -lm -lplot