"library1" should precede "library2" in the link command line
Check the order of your libraries.
The developer of library1 determined that it should be searched by the linker before library2. For example, library1 might contain an updated version of a function in library2. If you specify library2 first, the linker will link in the old version rather than the newer version from library1.