Link error - undefined reference to libcurl- Workaround?

anonymous via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Fri Apr 10 12:24:50 PDT 2015


LDC fails to link my application with the error message

ldc2-0.15.2-beta1-linux-x86_64/bin/../lib/libphobos2-ldc.a(curl.o): 
In Funktion `_D3std3net4curl4HTTP18_sharedStaticCtor1FZv':
/build/src/ldc/runtime/phobos/std/net/curl.d:(.text._D3std3net4curl4HTTP18_sharedStaticCtor1FZv+0x10): 
Nicht definierter Verweis auf `curl_version_info'
/opt/ldc2-0.15.2-beta1-linux-x86_64/bin/../lib/libphobos2-ldc.a(curl.o): 
In Funktion `_D3std3net4curl4Curl18_sharedStaticDtor3FZv':
/build/src/ldc/runtime/phobos/std/net/curl.d:(.text._D3std3net4curl4Curl18_sharedStaticDtor3FZv+0x1): 
Nicht definierter Verweis auf `curl_global_cleanup'
/opt/ldc2-0.15.2-beta1-linux-x86_64/bin/../lib/libphobos2-ldc.a(curl.o): 
In Funktion `_D3std3net4curl13__shared_ctorZ':
/build/src/ldc/runtime/phobos/std/net/curl.d:(.text._D3std3net4curl13__shared_ctorZ+0x10): 
Nicht definierter Verweis auf `curl_global_init'
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1

Version: 0.15.2-beta1, binary from github repo.
Linux Mint 17, 64 Bit

The app does not use std.net, libcurl or anything like that - 
it's mainly math and some file IO.

I found https://github.com/ldc-developers/ldc/issues/683 but it 
does not mention any workarounds.
Are there any known workarounds for this issue? -L=-lcurl does 
not work for me.
For same strange reason DUB (with ldc) can build the app in debug 
mode while ldc *.d fails.
With --build=release DUB produces the same error...



More information about the digitalmars-d-ldc mailing list