www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20690] New: Static LibCurl


          Issue ID: 20690
           Summary: Static LibCurl
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: svnpenn gmail.com

It seems it is not current possible to statically link LibCurl. I compiled my

git clone --depth 1 git://github.com/curl/curl
cd curl
mingw32-make -C lib -f Makefile.m32

but it fails with `std.net.curl`:

$ cat std_net_curl.d
import std.net.curl;
void main() {
   auto s1 = "http://speedtest.lax.hivelocity.net";

$ ldc2 std_net_curl.d wldap32.lib libcurl.lib
$ ./std_net_curl

std.net.curl.CurlException std\net\curl.d(4223): Failed to load curl, tried
"libcurl.dll", "curl.dll".

and it fails with `etc.c.curl`:

$ cat etc_c_curl.d
import etc.c.curl;
void main() {

$ ldc2 etc_c_curl.d wldap32.lib libcurl.lib
lld-link: error: libcurl.lib(easy.o): invalid symbol index in addrsig section

looking at the code, it seems the problem is here:

alias loadSym = GetProcAddress;


I am not an expert, but I think `GetProcAddress` is for working with DLL, not
static libraries:


Mar 21 2020