This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Linking order question
- From: Riccardo Manfrin <riccardomanfrin at gmail dot com>
- To: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 13 Nov 2013 16:26:41 +0100
- Subject: Linking order question
- Authentication-results: sourceware.org; auth=none
A library *BAR* is composed of the object file *bar**.o* that contains
the symbol *foo* and *qux*.
A *FOO* library depends on symbol *foo*.
A *QUX* library depends on symbol *qux***.
Can I assert the following linking orders outcomes?
-lFOO -lQUX -lBAR : OK and logically right
-lFOO -lBAR -lQUX : OK <-- this still works because FOO brought
in bar.o so QUX still finds the qux symbol.
-lBAR -lQUX : FAIL bar.o is excluded because it was not
found to be useful to anyone preceeding -lBAR.
Is this correct?
Thanks and regards,
RM