On Monday, 17 August 2015 at 12:58:54 UTC, Adam D. Ruppe wrote:
On Monday, 17 August 2015 at 12:52:37 UTC, tired_eyes wrote:
Hovewer, "dmd app.d" spits a whole bunch of strange error messages:

try "dmd -lcurl app.d" and see if that helps.

DMD does not accept -lcurl. From dmd --help:
 -Llinkerflag   pass linkerflag to link
ergo
 dmd -L-lcurl app.d

on my machine (64Bit linux mint 17.2 with libcurl4-openssl-dev installed) -L-lcurl reduces the number of linker errors but the example still fails. I run
dmd -c app.d
dmd -L-lcurl app.o -v

and figured out that the linker is invoked (on my machine) with
gcc a.o -o a -m64 -lcurl -L/usr/lib/x86_64-linux-gnu -Xlinker --export-dynamic -l:libphobos2.a -lpthread -lm -lrt If I change the order of the libraries (move -lcurl to the end), it links. Used commands:
dmd -c app.d
gcc app.o -o app -m64 -L/usr/lib/x86_64-linux-gnu -Xlinker --export-dynamic -l:libphobos2.a -lpthread -lm -lrt -lcurl (the later may be different on OpenSUSE (?) - better check with dmd -v ...)

Reply via email to