linking-in libs under linux needed and not under windows
Mike Parker via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Aug 26 21:56:48 PDT 2015
On Thursday, 27 August 2015 at 03:17:57 UTC, BBasile wrote:
> On Thursday, 27 August 2015 at 02:50:58 UTC, BBasile wrote:
>> So the Q: Is this difference normal ?
> the win OMF & linux COFF "thing" maybe ?
If I understand your problem description correctly, the culprit
is likely the order in which the libraries are passed to the
linker. The way the GNU linker works requires any library X that
depends on any library Y to be placed before library Y on the
command line.
So, given your example, if libB uses symbols from libA, then it
needs to come before libA on the command line.
dmd sourceProject.d -L-lB -L-lA -I<pathToSourceA>
-I<pathToSourceB>
You can also see this when you use the pragma(lib) feature, as
dmd passes the libraries to the linker in the order in which it
found the pragmas.
More information about the Digitalmars-d-learn
mailing list