www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.net.curl not working in 2.058 for Windows

reply "Brad Anderson" <eco gnuk.net> writes:
There is no documentation (both on dlang.org and in the local 
documentation) so I'm not sure if it's supposed to be working 
yet.  I get linker errors when I try to use it:

     $ dmd netcurl.d
     OPTLINK (R) for Win32  Release 8.00.12
     Copyright (C) Digital Mars 1989-2010  All rights reserved.
     http://www.digitalmars.com/ctg/optlink.html
     netcurl.obj(netcurl)
      Error 42: Symbol Undefined 
_D3std3net4curl3FTP8__cpctorMxFKxS3std3net4curl3FTPZv
     netcurl.obj(netcurl)
      Error 42: Symbol Undefined 
_D3std3net4curl3FTP11__fieldDtorMFZv
     netcurl.obj(netcurl)
      Error 42: Symbol Undefined _D3std3net4curl3FTP7performMFZv
     netcurl.obj(netcurl)
      Error 42: Symbol Undefined 
_D3std3net4curl13CurlException7__ClassZ
     netcurl.obj(netcurl)
      Error 42: Symbol Undefined 
_D3std3net4curl13CurlException6__ctorMFAyaAyakC6object9ThrowableZC3std3net4curl13CurlException
     netcurl.obj(netcurl)

     [snip]

Furthermore the documentation in the actual source says this 
should work:

     string content = get("http://dlang.org");

But that results in a compiler error error:

     netcurl.d(5): Error: cannot implicitly convert expression 
(get("http://dlang.org",AutoProtocol())) of type char[] to string

get() signature from the source is:

     T[] get(Conn = AutoProtocol, T = char)(const(char)[] url, 
Conn conn = Conn())
         if ( isCurlConn!Conn && (is(T == char) || is(T == ubyte)) 
)

An .idup fixes it, of course, but the documentation is wrong (or 
the signature is wrong).

Finally, was the curl library included?  If not, where can it be 
found?  It needs to be an OMF version, right?  I don't see an OMF 
version on curl's website.

Regards,
Brad Anderson
Feb 23 2012
next sibling parent "Brad Anderson" <eco gnuk.net> writes:
On Friday, 24 February 2012 at 07:59:50 UTC, Brad Anderson wrote:
 There is no documentation (both on dlang.org and in the local 
 documentation) so I'm not sure if it's supposed to be working 
 yet.  I get linker errors when I try to use it:

     $ dmd netcurl.d
     OPTLINK (R) for Win32  Release 8.00.12
     Copyright (C) Digital Mars 1989-2010  All rights reserved.
     http://www.digitalmars.com/ctg/optlink.html
     netcurl.obj(netcurl)
      Error 42: Symbol Undefined 
 _D3std3net4curl3FTP8__cpctorMxFKxS3std3net4curl3FTPZv
     netcurl.obj(netcurl)
      Error 42: Symbol Undefined 
 _D3std3net4curl3FTP11__fieldDtorMFZv
     netcurl.obj(netcurl)
      Error 42: Symbol Undefined _D3std3net4curl3FTP7performMFZv
     netcurl.obj(netcurl)
      Error 42: Symbol Undefined 
 _D3std3net4curl13CurlException7__ClassZ
     netcurl.obj(netcurl)
      Error 42: Symbol Undefined 
 _D3std3net4curl13CurlException6__ctorMFAyaAyakC6object9ThrowableZC3std3net4curl13CurlException
     netcurl.obj(netcurl)

     [snip]

 Furthermore the documentation in the actual source says this 
 should work:

     string content = get("http://dlang.org");

 But that results in a compiler error error:

     netcurl.d(5): Error: cannot implicitly convert expression 
 (get("http://dlang.org",AutoProtocol())) of type char[] to 
 string

 get() signature from the source is:

     T[] get(Conn = AutoProtocol, T = char)(const(char)[] url, 
 Conn conn = Conn())
         if ( isCurlConn!Conn && (is(T == char) || is(T == 
 ubyte)) )

 An .idup fixes it, of course, but the documentation is wrong 
 (or the signature is wrong).

 Finally, was the curl library included?  If not, where can it 
 be found?  It needs to be an OMF version, right?  I don't see 
 an OMF version on curl's website.

 Regards,
 Brad Anderson

It would appear phobos's win32.mak wasn't updated to include the curl wrapper. I can try to figure out how the makefile works and send a pull request if nobody who knows what's going on has time. Regards, Brad Anderson
Feb 24 2012
prev sibling parent "Brad Anderson" <eco gnuk.net> writes:
On Friday, 24 February 2012 at 08:47:14 UTC, Brad Anderson wrote:
 On Friday, 24 February 2012 at 07:59:50 UTC, Brad Anderson 
 wrote:
 There is no documentation (both on dlang.org and in the local 
 documentation) so I'm not sure if it's supposed to be working 
 yet.  I get linker errors when I try to use it:

    $ dmd netcurl.d
    OPTLINK (R) for Win32  Release 8.00.12
    Copyright (C) Digital Mars 1989-2010  All rights reserved.
    http://www.digitalmars.com/ctg/optlink.html
    netcurl.obj(netcurl)
     Error 42: Symbol Undefined 
 _D3std3net4curl3FTP8__cpctorMxFKxS3std3net4curl3FTPZv
    netcurl.obj(netcurl)
     Error 42: Symbol Undefined 
 _D3std3net4curl3FTP11__fieldDtorMFZv
    netcurl.obj(netcurl)
     Error 42: Symbol Undefined _D3std3net4curl3FTP7performMFZv
    netcurl.obj(netcurl)
     Error 42: Symbol Undefined 
 _D3std3net4curl13CurlException7__ClassZ
    netcurl.obj(netcurl)
     Error 42: Symbol Undefined 
 _D3std3net4curl13CurlException6__ctorMFAyaAyakC6object9ThrowableZC3std3net4curl13CurlException
    netcurl.obj(netcurl)

    [snip]

 Furthermore the documentation in the actual source says this 
 should work:

    string content = get("http://dlang.org");

 But that results in a compiler error error:

    netcurl.d(5): Error: cannot implicitly convert expression 
 (get("http://dlang.org",AutoProtocol())) of type char[] to 
 string

 get() signature from the source is:

    T[] get(Conn = AutoProtocol, T = char)(const(char)[] url, 
 Conn conn = Conn())
        if ( isCurlConn!Conn && (is(T == char) || is(T == 
 ubyte)) )

 An .idup fixes it, of course, but the documentation is wrong 
 (or the signature is wrong).

 Finally, was the curl library included?  If not, where can it 
 be found?  It needs to be an OMF version, right?  I don't see 
 an OMF version on curl's website.

 Regards,
 Brad Anderson

It would appear phobos's win32.mak wasn't updated to include the curl wrapper. I can try to figure out how the makefile works and send a pull request if nobody who knows what's going on has time. Regards, Brad Anderson

https://github.com/D-Programming-Language/phobos/pull/458 https://github.com/D-Programming-Language/d-programming-language.org/pull/91 Regards, Brad Anderson
Feb 24 2012