www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Using std.net.curl

reply "Gary Willoughby" <dev kalekold.net> writes:
I'm using the built-in curl library on Linux i'm getting linker 
errors. I've installed libcurl4-openssl-dev and it works fine as 
i can successfully compile a sample program. However when using 
the D lib i get these errors:

[quote]
:!rdmd api_test.d
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/l
bphobos2.a(curl.o): 
In function `_D3std3net4curl4Curl19_sharedStaticCtor28FZv':
std/net/curl.d:(.text._D3std3net4curl4Curl19_sharedStaticCtor28FZv+0xf): 
undefined reference to `curl_global_init'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/l
bphobos2.a(curl.o): 
In function `_D3std3net4curl4Curl19_sharedStaticDtor29FZv':
std/net/curl.d:(.text._D3std3net4curl4Curl19_sharedStaticDtor29FZv+0x5): 
undefined reference to `curl_global_cleanup'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_13fa_140.o): 
In function `_D3std3net4curl4HTTP4Impl6__dtorMFZv':
std/net/curl.d:(.text._D3std3net4curl4HTTP4Impl6__dtorMFZv+0x19): 
undefined reference to `curl_slist_free_all'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_13fa_140.o): 
In function `_D3std3net4curl4HTTP3dupMFZS3std3net4curl4HTTP':
std/net/curl.d:(.text._D3std3net4curl4HTTP3dupMFZS3std3net4curl4HTTP+0x6b): 
undefined reference to `curl_slist_append'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_13fa_140.o): 
In function `_D3std3net4curl4HTTP19clearRequestHeadersMFZv':
std/net/curl.d:(.text._D3std3net4curl4HTTP19clearRequestHeadersMFZv+0x22): 
undefined reference to `curl_slist_free_all'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_13fa_140.o): 
In function `_D3std3net4curl4HTTP16addRequestHeaderMFAxaAxaZv':
std/net/curl.d:(.text._D3std3net4curl4HTTP16addRequestHeaderMFAxaAxaZv+0x5b): 
undefined reference to `curl_slist_append'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos
.a(curl_13fb_ea.o): 
In function `_D3std3net4curl3FTP4Impl6__dtorMFZv':
std/net/curl.d:(.text._D3std3net4curl3FTP4Impl6__dtorMFZv+0x18): 
undefined reference to `curl_slist_free_all'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos
.a(curl_13fb_ea.o): 
In function `_D3std3net4curl3FTP3dupMFZS3std3net4curl3FTP':
std/net/curl.d:(.text._D3std3net4curl3FTP3dupMFZS3std3net4curl3FTP+0xa6): 
undefined reference to `curl_slist_append'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos
.a(curl_13fb_ea.o): 
In function `_D3std3net4curl3FTP13clearCommandsMFZv':
std/net/curl.d:(.text._D3std3net4curl3FTP13clearCommandsMFZv+0x20): 
undefined reference to `curl_slist_free_all'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos
.a(curl_13fb_ea.o): 
In function `_D3std3net4curl3FTP10addCommandMFAxaZv':
std/net/curl.d:(.text._D3std3net4curl3FTP10addCommandMFAxaZv+0x31): 
undefined reference to `curl_slist_append'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1400_432.o): 
In function `_D3std3net4curl4Curl10initializeMFZv':
std/net/curl.d:(.text._D3std3net4curl4Curl10initializeMFZv+0x42): 
undefined reference to `curl_easy_init'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1401_149.o): 
In function `_D3std3net4curl4Curl3dupMFZS3std3net4curl4Curl':
std/net/curl.d:(.text._D3std3net4curl4Curl3dupMFZS3std3net4curl4Curl+0x28): 
undefined reference to `curl_easy_duphandle'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1405_37c.o): 
In function `_D3std3net4curl4Curl8shutdownMFZv':
std/net/curl.d:(.text._D3std3net4curl4Curl8shutdownMFZv+0x1e): 
undefined reference to `curl_easy_cleanup'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1407_14c.o): 
In function 
`_D3std3net4curl4Curl3setMFE3etc1c4curl10CurlOptionAxaZv':
std/net/curl.d:(.text._D3std3net4curl4Curl3setMFE3etc1c4curl10Cu
lOptionAxaZv+0x35): 
undefined reference to `curl_easy_setopt'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1408_14c.o): 
In function 
`_D3std3net4curl4Curl3setMFE3etc1c4curl10CurlOptionlZv':
std/net/curl.d:(.text._D3std3net4curl4Curl3setMFE3etc1c4curl10
urlOptionlZv+0x2e): 
undefined reference to `curl_easy_setopt'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1409_14c.o): 
In function 
`_D3std3net4curl4Curl3setMFE3etc1c4curl10CurlOptionPvZv':
std/net/curl.d:(.text._D3std3net4curl4Curl3setMFE3etc1c4curl10C
rlOptionPvZv+0x2e): 
undefined reference to `curl_easy_setopt'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_140a_207.o): 
In function 
`_D3std3net4curl4Curl5clearMFE3etc1c4curl10CurlOptionZv':
std/net/curl.d:(.text._D3std3net4curl4Curl5clearMFE3etc1c4curl1
CurlOptionZv+0x26): 
undefined reference to `curl_easy_setopt'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_140b_2fb.o): 
In function `_D3std3net4curl4Curl7performMFbZi':
std/net/curl.d:(.text._D3std3net4curl4Curl7performMFbZi+0x23): 
undefined reference to `curl_easy_perform'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1403_4a1.o): 
In function `_D3std3net4curl4Curl11errorStringMFiZAya':
std/net/curl.d:(.text._D3std3net4curl4Curl11errorStringMFiZAya+0x11): 
undefined reference to `curl_easy_strerror'
collect2: ld returned 1 exit status
--- errorlevel 1

shell returned 1
[/quote]

I found this error which looks like what i'm getting posted on 
Stackoverflow:

http://stackoverflow.com/questions/10095150/std-net-curl-linker-errors-in-linux

Is there a fix for this? It looks like the linker parameters are 
in the wrong order.
Jul 01 2012
next sibling parent reply Brad Anderson <eco gnuk.net> writes:
On Sun, Jul 1, 2012 at 10:59 AM, Gary Willoughby <dev kalekold.net> wrote:

 I'm using the built-in curl library on Linux i'm getting linker errors.
 I've installed libcurl4-openssl-dev and it works fine as i can successfully
 compile a sample program. However when using the D lib i get these errors:

 [quote]
 :!rdmd api_test.d
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl.o):
 In function `_D3std3net4curl4Curl19_**sharedStaticCtor28FZv':
 std/net/curl.d:(.text._**D3std3net4curl4Curl19_**sharedStaticCtor28FZv+0xf):
 undefined reference to `curl_global_init'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl.o):
 In function `_D3std3net4curl4Curl19_**sharedStaticDtor29FZv':
 std/net/curl.d:(.text._**D3std3net4curl4Curl19_**sharedStaticDtor29FZv+0x5):
 undefined reference to `curl_global_cleanup'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_13fa_140.o):
 In function `_D3std3net4curl4HTTP4Impl6__**dtorMFZv':
 std/net/curl.d:(.text._**D3std3net4curl4HTTP4Impl6__**dtorMFZv+0x19):
 undefined reference to `curl_slist_free_all'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_13fa_140.o):
 In function `_**D3std3net4curl4HTTP3dupMFZS3st**d3net4curl4HTTP':
 std/net/curl.d:(.text._**D3std3net4curl4HTTP3dupMFZS3st**d3net4curl4HTTP+0x6b):
 undefined reference to `curl_slist_append'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_13fa_140.o):
 In function `_**D3std3net4curl4HTTP19clearRequ**estHeadersMFZv':
 std/net/curl.d:(.text._**D3std3net4curl4HTTP19clearRequ**estHeadersMFZv+0x22):
 undefined reference to `curl_slist_free_all'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_13fa_140.o):
 In function `_**D3std3net4curl4HTTP16addReques**tHeaderMFAxaAxaZv':
 std/net/curl.d:(.text._**D3std3net4curl4HTTP16addReques**tHeaderMFAxaAxaZv+0x5b):
 undefined reference to `curl_slist_append'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_13fb_ea.o):
 In function `_D3std3net4curl3FTP4Impl6__**dtorMFZv':
 std/net/curl.d:(.text._**D3std3net4curl3FTP4Impl6__**dtorMFZv+0x18):
 undefined reference to `curl_slist_free_all'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_13fb_ea.o):
 In function `_**D3std3net4curl3FTP3dupMFZS3std**3net4curl3FTP':
 std/net/curl.d:(.text._**D3std3net4curl3FTP3dupMFZS3std**3net4curl3FTP+0xa6):
 undefined reference to `curl_slist_append'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_13fb_ea.o):
 In function `_**D3std3net4curl3FTP13clearComma**ndsMFZv':
 std/net/curl.d:(.text._**D3std3net4curl3FTP13clearComma**ndsMFZv+0x20):
 undefined reference to `curl_slist_free_all'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_13fb_ea.o):
 In function `_**D3std3net4curl3FTP10addCommand**MFAxaZv':
 std/net/curl.d:(.text._**D3std3net4curl3FTP10addCommand**MFAxaZv+0x31):
 undefined reference to `curl_slist_append'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_1400_432.o):
 In function `_**D3std3net4curl4Curl10initializ**eMFZv':
 std/net/curl.d:(.text._**D3std3net4curl4Curl10initializ**eMFZv+0x42):
 undefined reference to `curl_easy_init'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_1401_149.o):
 In function `_**D3std3net4curl4Curl3dupMFZS3st**d3net4curl4Curl':
 std/net/curl.d:(.text._**D3std3net4curl4Curl3dupMFZS3st**d3net4curl4Curl+0x28):
 undefined reference to `curl_easy_duphandle'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_1405_37c.o):
 In function `_**D3std3net4curl4Curl8shutdownMF**Zv':
 std/net/curl.d:(.text._**D3std3net4curl4Curl8shutdownMF**Zv+0x1e):
 undefined reference to `curl_easy_cleanup'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_1407_14c.o):
 In function `_**D3std3net4curl4Curl3setMFE3etc**1c4curl10CurlOptionAxaZv':
 std/net/curl.d:(.text._**D3std3net4curl4Curl3setMFE3etc**
 1c4curl10CurlOptionAxaZv+0x35)**: undefined reference to
 `curl_easy_setopt'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_1408_14c.o):
 In function `_**D3std3net4curl4Curl3setMFE3etc**1c4curl10CurlOptionlZv':
 std/net/curl.d:(.text._**D3std3net4curl4Curl3setMFE3etc**1c4curl10CurlOptionlZv+0x2e):
 undefined reference to `curl_easy_setopt'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_1409_14c.o):
 In function `_**D3std3net4curl4Curl3setMFE3etc**1c4curl10CurlOptionPvZv':
 std/net/curl.d:(.text._**D3std3net4curl4Curl3setMFE3etc**1c4curl10CurlOptionPvZv+0x2e):
 undefined reference to `curl_easy_setopt'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_140a_207.o):
 In function `_**D3std3net4curl4Curl5clearMFE3e**tc1c4curl10CurlOptionZv':
 std/net/curl.d:(.text._**D3std3net4curl4Curl5clearMFE3e**tc1c4curl10CurlOptionZv+0x26):
 undefined reference to `curl_easy_setopt'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_140b_2fb.o):
 In function `_**D3std3net4curl4Curl7performMFb**Zi':
 std/net/curl.d:(.text._**D3std3net4curl4Curl7performMFb**Zi+0x23):
 undefined reference to `curl_easy_perform'
 /usr/lib/gcc/x86_64-linux-gnu/**4.6/../../../x86_64-linux-gnu/**libphobos2.a(curl_1403_4a1.o):
 In function `_**D3std3net4curl4Curl11errorStri**ngMFiZAya':
 std/net/curl.d:(.text._**D3std3net4curl4Curl11errorStri**ngMFiZAya+0x11):
 undefined reference to `curl_easy_strerror'
 collect2: ld returned 1 exit status
 --- errorlevel 1

 shell returned 1
 [/quote]

 I found this error which looks like what i'm getting posted on
 Stackoverflow:

 http://stackoverflow.com/**questions/10095150/std-net-**
 curl-linker-errors-in-linux<http://stackoverflow.com/questions/10095150/std-net-curl-linker-errors-in-linux>

 Is there a fix for this? It looks like the linker parameters are in the
 wrong order.

I just ended up specifying the link command manually (see my answer on the Stack Overflow). It's ugly but it works. Leandro discusses a solution here: <http://d.puremagic.com/issues/show_bug.cgi?id=7044#c1> It hasn't been implemented yet though. Regards, Brad Anderson
Jul 04 2012
parent "Volodymyr Kvyt" <vova.cpp gmail.com> writes:
On Wednesday, 4 July 2012 at 17:19:02 UTC, Brad Anderson wrote:
 I just ended up specifying the link command manually (see my 
 answer on the
 Stack Overflow).  It's ugly but it works.  Leandro discusses a 
 solution
 here: <http://d.puremagic.com/issues/show_bug.cgi?id=7044#c1> 
 It hasn't
 been implemented yet though.

 Regards,
 Brad Anderson

I have the same problem as in the top. When i add -L-lphobos2 -L-lcurl to the compiler options i get this error: Fatal Error while loading '/usr/lib/x86_64-linux-gnu/libphobos2.so.0.65': The module 'std.regex' is already defined in './main'. Segmentation fault (core dumped)
Apr 08 2014
prev sibling parent reply 1100110 <10equals2 gmail.com> writes:
Specifying them in the oposite order one the command line worked for me a  
few days ago.

I swear.



On Sun, 01 Jul 2012 11:59:59 -0500, Gary Willoughby <dev kalekold.net>  
wrote:

 I'm using the built-in curl library on Linux i'm getting linker errors.  
 I've installed libcurl4-openssl-dev and it works fine as i can  
 successfully compile a sample program. However when using the D lib i  
 get these errors:

 [quote]
 :!rdmd api_test.d
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/l
bphobos2.a(curl.o):  
 In function `_D3std3net4curl4Curl19_sharedStaticCtor28FZv':
 std/net/curl.d:(.text._D3std3net4curl4Curl19_sharedStaticCtor28FZv+0xf):  
 undefined reference to `curl_global_init'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/l
bphobos2.a(curl.o):  
 In function `_D3std3net4curl4Curl19_sharedStaticDtor29FZv':
 std/net/curl.d:(.text._D3std3net4curl4Curl19_sharedStaticDtor29FZv+0x5):  
 undefined reference to `curl_global_cleanup'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_13fa_140.o):  
 In function `_D3std3net4curl4HTTP4Impl6__dtorMFZv':
 std/net/curl.d:(.text._D3std3net4curl4HTTP4Impl6__dtorMFZv+0x19):  
 undefined reference to `curl_slist_free_all'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_13fa_140.o):  
 In function `_D3std3net4curl4HTTP3dupMFZS3std3net4curl4HTTP':
 std/net/curl.d:(.text._D3std3net4curl4HTTP3dupMFZS3std3net4curl4HTTP+0x6b):  
 undefined reference to `curl_slist_append'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_13fa_140.o):  
 In function `_D3std3net4curl4HTTP19clearRequestHeadersMFZv':
 std/net/curl.d:(.text._D3std3net4curl4HTTP19clearRequestHeadersMFZv+0x22):  
 undefined reference to `curl_slist_free_all'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_13fa_140.o):  
 In function `_D3std3net4curl4HTTP16addRequestHeaderMFAxaAxaZv':
 std/net/curl.d:(.text._D3std3net4curl4HTTP16addRequestHeaderMFAxaAxaZv+0x5b):  
 undefined reference to `curl_slist_append'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos
.a(curl_13fb_ea.o):  
 In function `_D3std3net4curl3FTP4Impl6__dtorMFZv':
 std/net/curl.d:(.text._D3std3net4curl3FTP4Impl6__dtorMFZv+0x18):  
 undefined reference to `curl_slist_free_all'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos
.a(curl_13fb_ea.o):  
 In function `_D3std3net4curl3FTP3dupMFZS3std3net4curl3FTP':
 std/net/curl.d:(.text._D3std3net4curl3FTP3dupMFZS3std3net4curl3FTP+0xa6):  
 undefined reference to `curl_slist_append'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos
.a(curl_13fb_ea.o):  
 In function `_D3std3net4curl3FTP13clearCommandsMFZv':
 std/net/curl.d:(.text._D3std3net4curl3FTP13clearCommandsMFZv+0x20):  
 undefined reference to `curl_slist_free_all'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos
.a(curl_13fb_ea.o):  
 In function `_D3std3net4curl3FTP10addCommandMFAxaZv':
 std/net/curl.d:(.text._D3std3net4curl3FTP10addCommandMFAxaZv+0x31):  
 undefined reference to `curl_slist_append'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1400_432.o):  
 In function `_D3std3net4curl4Curl10initializeMFZv':
 std/net/curl.d:(.text._D3std3net4curl4Curl10initializeMFZv+0x42):  
 undefined reference to `curl_easy_init'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1401_149.o):  
 In function `_D3std3net4curl4Curl3dupMFZS3std3net4curl4Curl':
 std/net/curl.d:(.text._D3std3net4curl4Curl3dupMFZS3std3net4curl4Curl+0x28):  
 undefined reference to `curl_easy_duphandle'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1405_37c.o):  
 In function `_D3std3net4curl4Curl8shutdownMFZv':
 std/net/curl.d:(.text._D3std3net4curl4Curl8shutdownMFZv+0x1e): undefined  
 reference to `curl_easy_cleanup'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1407_14c.o):  
 In function `_D3std3net4curl4Curl3setMFE3etc1c4curl10CurlOptionAxaZv':
 std/net/curl.d:(.text._D3std3net4curl4Curl3setMFE3etc1c4curl10Cu
lOptionAxaZv+0x35):  
 undefined reference to `curl_easy_setopt'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1408_14c.o):  
 In function `_D3std3net4curl4Curl3setMFE3etc1c4curl10CurlOptionlZv':
 std/net/curl.d:(.text._D3std3net4curl4Curl3setMFE3etc1c4curl10
urlOptionlZv+0x2e):  
 undefined reference to `curl_easy_setopt'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1409_14c.o):  
 In function `_D3std3net4curl4Curl3setMFE3etc1c4curl10CurlOptionPvZv':
 std/net/curl.d:(.text._D3std3net4curl4Curl3setMFE3etc1c4curl10C
rlOptionPvZv+0x2e):  
 undefined reference to `curl_easy_setopt'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_140a_207.o):  
 In function `_D3std3net4curl4Curl5clearMFE3etc1c4curl10CurlOptionZv':
 std/net/curl.d:(.text._D3std3net4curl4Curl5clearMFE3etc1c4curl1
CurlOptionZv+0x26):  
 undefined reference to `curl_easy_setopt'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_140b_2fb.o):  
 In function `_D3std3net4curl4Curl7performMFbZi':
 std/net/curl.d:(.text._D3std3net4curl4Curl7performMFbZi+0x23): undefined  
 reference to `curl_easy_perform'
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libphobos2
a(curl_1403_4a1.o):  
 In function `_D3std3net4curl4Curl11errorStringMFiZAya':
 std/net/curl.d:(.text._D3std3net4curl4Curl11errorStringMFiZAya+0x11):  
 undefined reference to `curl_easy_strerror'
 collect2: ld returned 1 exit status
 --- errorlevel 1

 shell returned 1
 [/quote]

 I found this error which looks like what i'm getting posted on  
 Stackoverflow:

 http://stackoverflow.com/questions/10095150/std-net-curl-linker-errors-in-linux

 Is there a fix for this? It looks like the linker parameters are in the  
 wrong order.

-- Using Opera's revolutionary email client: http://www.opera.com/mail/
Jul 06 2012
parent "Gary Willoughby" <dev kalekold.net> writes:
Yeah invoking the linker manually works fine.

To save me from that each time i've actually added '-L-lphobos2' 
to the end of 'DFLAGS' in '/etc/dmd.conf' so phobos is always 
before curl in the linker argument list. When the program is 
compiled '-L-lphobos2' appears twice in the args but that's no 
big deal (i hope :p ).

Thanks.
Jul 07 2012