An interesting property of memory is that it is

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ed: When libvector.a is processed, Í is empty, so no member object files from libvector.a are added to . Thus the reference to addvec is never resolved, and the linker emits an error message and terminates.. The general rule for libraries is to place them at the end of the command line. If the members of the different libraries are independent, in that no member references a symbol defined by another member, then the libraries can be placed at the end of the command line in any order. On the other hand, if the libraries are not independent, then they must be ordered so that for each symbol × that is referenced externally by a member of an archive, at least one definition of × follows a reference to × on the command line. For example, suppose foo.c calls functions in libx.a and libz.a that call functions in liby.a. Then libx.a and libz.a must precede liby.a on the command line: unix> gcc foo.c libx.a libz.a liby.a Libraries can be repeated on the command line if necessary to satisfy the dependence requirements. Fo...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online