On Sun, Oct 21, 2012 at 3:44 PM, Lars Viklund
<zao@acc.umu.se> wrote:
On Sun, Oct 21, 2012 at 01:55:48PM -0400, Joseph Sulewski wrote:
> Steven,
>
> Thank you for the reply. It is definitely something order related. I took
> your advice and moved the boost_program_options to the end but now I get a
> lot of different errors. Is there any documentation that guides the order
> in which the boost libraries should be linked?
Please do not top-post on the Boost lists.
Linker command line ordering is largely due to historical reasons with
ld-like linkers, and is considered a feature by some.
In absence of the group options that changes scan behaviour, library
resolution works roughly like this:
The command line is scanned from left to right. Missing symbols are
recorded as it scans. When something providing symbols is encountered,
all missing symbols it can fulfil are filled and the rest are ignored.
The end result is that if you list something that provides symbols too
early on the command line, there's nothing that needs those symbols yet
and they're all discarded.
This is how traditional linking against static libraries work. Dynamic
libraries are somewhat different, and newer toolchains have some changes
in visiblity that may affect how links are performed.
All in all, it's rarely wrong to play it safe and topologically sort
your command line in dependency order.
--
Lars Viklund | zao@acc.umu.se
Thank you for the explanation The problem i'm facing is that I'm linking against a third party library and I don't know their dependencies. Is there a dependency order for the boost libraries?