I think you've got things backwards: the -no-undefined flag doesn't really make sense _unless_
shared library dependencies exist.
With the -no-undefined flag set, your library must directly link to all the libraries whose
symbols you used (leaving no "undefined" symbols).
Even on platforms where -no-undefined is not required, it is usually worth using since the
linker can see which library each referenced symbol comes from, making the job of runtime
linking easier.
Posted Feb 7, 2008 5:02 UTC (Thu) by stevenj (guest, #421)
[Link]
Even if there are no library inter-dependencies in your library, you must specify -no-undefined or libtool will refuse to build it on AIX or MinGW, since libtool is apparently unable to detect automatically whether there are unresolved symbols at link time. But you're right that the flag can also be used if you specify library dependencies with -l flags explicitly at link time.
I've also heard that this is useful for prelinking as well, as you mention.
(Apparently, -no-undefined used to be the default, which seems sensible to me, but supposedly they got too many complaints.)