The position of an archive on the command-line can affect the output file being produced. The link-editor searches an archive only to resolve undefined or tentative external references it has previously seen. Once this search is completed and the required relocatable objects have been extracted, the archive will not be available to resolve any new symbols obtained from the input files that follow the archive on the command-line. For example, the command
$ cc -o prog file1.c -Bstatic -lfoo file2.c file3.c -Bdynamic |
directs the link-editor to search libfoo.a only to resolved symbol references that have been obtained from file1.c. libfoo.a will not be available to resolve symbol references from file2.c or file3.c.
As a rule, it is best to specify any archives at the end of the command-line unless multiple-definition conflicts require you to do otherwise.