cURL / Mailing Lists / curl-library / Single Mail


Re: Asking about compiling libcurl with libssh2 in Windows VC98

From: Ngo Hoa Lan Phuong <>
Date: Thu, 27 Nov 2008 15:59:07 +0700

> Are you building libcurl yourself or using someone else's binary?
> Whether libcurl supports sftp or not is determined by the options in
> effect at the time that libcurl itself was built, not at the point where
> you use it in your code. Enabling those defines in your code after the
> fact will not (and can not) change anything. It sounds like you are
> using a pre-built libcurl binary that was did not have sftp support
> enabled, in which case you simply need to build it yourself with the
> desired configuration.

I'm using zlib, openssl and libssh2 binary from internet to build libcurl
myself , but nothing came out of it. I didn't know exactly how to build
libcurl with sftp supports :(
Yesterday one of my friends compiled libcurl with libssh2 successfully (by
adding new options to CFLAGS, LINKLIB and X_OBJS in Makefile.vc6). And now
the libcurl, which i'm using, supports sftp protocol. Everything's ok if we
use only password authentication. But when using public/private key
authentication, we got the error: *OpenSSL_Uplink: no OpenSSL_Applink*. Is
the problem in the libeay32.dll/ssleay32.dll or libcurl aren't built
Here the code for test sftp:
hd_src = fopen("C:\\temp\\testFTP.txt", "rb");
    curl = curl_easy_init();
    if(curl) {
        curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
        curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
        curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
        curl_easy_setopt(curl, CURLOPT_USERPWD, "test:test");
        curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
        curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES,
        curl_easy_setopt(curl, CURLOPT_SSH_PUBLIC_KEYFILE,
        curl_easy_setopt(curl, CURLOPT_SSH_PRIVATE_KEYFILE,
        res = curl_easy_perform(curl);

        if(CURLE_OK != res) {
            fprintf(stderr, "curl told us %d\n", res);
Thanks for any help!
Received on 2008-11-27