> But I don't understand why a change in the order of dependencies > makes a difference in the order of libraries on the command line. > Can you explain it to me?
I don't know. I think it's works because used implicit rule which passes the target dependenses to the command line In command line I see that librwtest.a and libstd.a is specified twice: >From $(LDFLAGS): -L/usr/src/Incubator/stdcxx/trunk/build/rwtest -lrwtest -L/usr/src/Incubator/stdcxx/trunk/build/lib -lstd Appended target dependenses: /usr/src/Incubator/stdcxx/trunk/build/lib/libstd.a /usr/src/Incubator/stdcxx/trunk/build/rwtest/librwtest.a -lsupc++ -lm -o 21.string.io And I think that LD first uses the libraries specified in the command line directly, and only after that the libraries from -l options. Farid.