linking external libs

Nicholas Wilson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 2 05:10:50 PDT 2015


So test.d depends on libgmp.a

Unsurprisingly:
$dmd test.d
  fails to find libgmp.a

So tell it  to look
$dmd  -L-lgmp test.d

finds the wrong one or doesn't find it.

Tell it where to look

$dmd -L-L/usr/local/lib -L-lgmp test.d

Ok. Now it fails to find Phobos. Ok

$dmd -L-L/usr/local/lib -L-L/usr/share/dmd/lib -L-lgmp 
-L-lphobos2 test.d

... still fails to find Phobos. WTF? is there a way out of this 
revolving door?

reordering the linker flags doesn't seem to help.

Also is there a binding to GMP somewhere? I just hacked one 
together.

-Nic



More information about the Digitalmars-d-learn mailing list