cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Asking about compiling libcurl with libssh2 in Windows VC98

From: Ngo Hoa Lan Phuong <orchidanz_at_gmail.com>
Date: Wed, 26 Nov 2008 13:33:09 +0700

Hi, I'm a newbie with curl, I've read your messages in curl.haxx.se and
would like to ask you about compiling libcurl with libssh2 in windows.
I added /DUSE_LIBSSH2, /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H in my CFLAGS, using
libssh2.lib in LINKLIBS:

LIBSSH2_CFLAGS = /DUSE_LIBSSH2 /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H
LIBSSH2_LIBS = libssh2.lib

!IF "$(CFG)" == "release-dll"
CFLAGS = $(CFLAGS) $(LIBSSH2_CFLAGS)
LINKLIBS = libcurl_imp.lib $(LIBSSH2_LIBS)
LINKLIBS_DEBUG = libcurld_imp.lib $(LIBSSH2_LIBS)
!ENDIF

and using MSVC to compile libcurl from command line

cd lib
nmake -f Makefile.vc6 CFG=release-dll
cd ../src
nmake -f makefile.vc6 release CFG=release-dll

The step of compilation with cl.exe and link.exe was passed well. But when
I'm using libcurl to test SFTP I've got a code return
CURLE_UNSUPPORTED_PROTOCOL of curl_easy_perform function.
My code is simple like:
CURL* curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
      curl_easy_setopt(curl,CURLOPT_URL, "sftp://localhost");
      res = curl_easy_perform(curl);
      if (res == CURLE_OK) std::cout << "Success";
      else std::cout << "Not success: "<< res;
      curl_easy_cleanup(curl);
}
Could you help me to build libcurl with sftp support? Thanks so much!
Phuong.Ngo
Received on 2008-11-26