[QBS] Linking inter-dependent libraries using gcc

Lars Ivar Igesund larsivi at gmail.com
Sat Aug 8 18:42:19 CEST 2015

Hi Ilya,

I can't help you with the qbs issue, but I remember using a different build
tool that added lib dependencies throughout the produced linker commandline
to make sure to avoid any similar issues.

However, assuming you can do something about it (if not, complain to those
responsible), try to merge or reorganize the libraries so that they're not
Circular dependency graphs at most software levels is almost always a sign
of a future problem. I think it is often overlooked, but if the dependency
graph look like spaghetti, then things are bound to get messy. Personally,I
always put this high on the list of general requirements for my software.

Best regards,
Lars Ivar Igesund

On Fri, Aug 7, 2015 at 6:44 PM Ilya Lyubimov <villytiger at gmail.com> wrote:

> Hi,
> I'm trying to link inter-dependent libraries, but as qbs merges the list
> of libraries it seems to be impossible now.
> For example there are two libraries: liba.a and libb.a. liba.a uses
> symbols from libb.a and libb.a uses symbols from liba.a. Then using gcc
> they must be linked with the following command line: "-la -lb -la". But I
> can't get this behavior using cpp.staticLibraries property, because qbs
> passes each library only once. So in such situation the only way is to use
> low level linkerFlags.
> Things become more complicated if one of this libraries is produced by
> qbs, while another one is an external library. I don't know how to
> workaround in such case without using qbs internals (artifact paths).
> And finally two inter-dependent libraries built by qbs would produce graph
> cycle error.
> --
> С уважением, / Best regards
> Любимов Илья / Ilya Lyubimov
> _______________________________________________
> QBS mailing list
> QBS at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20150808/31d38f4b/attachment.html>

More information about the Qbs mailing list