# curl_loadlib

Definition: | include builtins\libcurl.e bool res = curl_loadlib(string dll_name="")
Description: | Optional. Allows an application to helpfully suggest and/or open (eg) http://phix.x10.mx/pmwiki/pmwiki.php?n=Main.Libcurldlls (windows only) or https://curl.haxx.se/download.html or even automatically download it (which might prove slightly difficult if you have not already got libcurl to download things with!), or perhaps even copy it from some install directory to the application or a system directory. The optional dll_name parameter also allows the library name to be explicitly specified, with either a relative or absolute path, and it should, obviously, be dependent on both platform() and machine_bits(). Otherwise the library is opened automatically, but if it cannot be found then it terminates abruptly with a console message, eg "cannot open LIBCURL.32.SK.DLL".
pwa/p2js: | Not supported.
Example: | Copy
    include pGUI.e
    include builtins\libcurl.e
    IupOpen()
    if not curl_loadlib() then
        string txt = sprintf("cannot open %s, download from ",{curl_dll_name}),
               lnk = "http://phix.x10.mx/pmwiki/pmwiki.php?n=Main.Libcurldlls"
        Ihandle dlg = IupDialog(IupHbox({IupLabel(txt),IupLink(lnk)},
                                "MARGIN=10x10"),"TITLE=Error")
        IupPopup(dlg)
        abort(0)
    end if
Note that an important point here is that libcurl does not depend on pGUI. As shown, the global string curl_dll_name contains the actual library it tried to open. (Of course, dll_name and curl_dll_name can/should be a .so file on linux)