Linking multiple libraries
Jacob Carlborg
doob at me.com
Sun Nov 26 11:15:58 UTC 2017
On 2017-11-25 23:31, Mike Parker wrote:
> You don't link static libraries with each other. They're just
> collections of object files intended to be linked with an executable or
> a DLL. Order doesn't matter for optlink or the MS linker, but other
> linkers, such as ld (which is commonly used with GCC) require the
> libraries be passed in according to dependencies, e.g. dependent
> libraries come before their dependencies. Not sure if the LLVM linker
> retains that behavior.
For completeness:
For "ld" on macOS the order does not matter. For "ld" on Linux the order
does matter, but, if necessary, the following flags can be used to link
libraries in any order: "--start-group" and "--end-group". Those flag
will cause the linker to search the libraries repeatedly to resolve
undefined symbols.
--
/Jacob Carlborg
More information about the Digitalmars-d-learn
mailing list