cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Asking about compiling libcurl with libssh2 in Windows VC98

From: Guenter Knauf <eflash_at_gmx.net>
Date: Thu, 25 Jan 2007 15:40:43 +0100

Hi,
> I have finished to compile the Curl in Windows with VC98. And the
> functions SFTP and SCP works well in Windows also.
hmm, but I wonder though how you did cover the missing defines without patching ssl.c:
ssh.c: In function `Curl_sftp_do':
ssh.c:726: error: `S_IFSOCK' undeclared (first use in this function)
ssh.c:726: error: (Each undeclared identifier is reported only once
ssh.c:726: error: for each function it appears in.)
ssh.c:749: error: `S_IWGRP' undeclared (first use in this function)
ssh.c:752: error: `S_IXGRP' undeclared (first use in this function)
ssh.c:758: error: `S_IWOTH' undeclared (first use in this function)
ssh.c:761: error: `S_IXOTH' undeclared (first use in this function)
make[1]: *** [ssh.o] Error 1
make[1]: Leaving directory
C:/Projects/srcs/autobuilds/checkout/curl/lib'
make: *** [mingw32-ssh2-ssl] Error 2

I searched through the MingW32 headers, and through my MSVC6 platform SDK - but nowehere these are defined...

so I think we need some ifdef blocks in the code - but not sure yet if this is the right go:

--- ssh.c.orig Tue Jan 23 23:34:18 2007
+++ ssh.c Thu Jan 25 12:52:44 2007
@@ -146,6 +146,10 @@
 #define S_IROTH 0
 #endif
 
+#ifndef S_IFLNK
+#define S_IFLNK 0xA000
+#endif
+
 #define LIBSSH2_SFTP_S_IRUSR S_IRUSR
 #define LIBSSH2_SFTP_S_IWUSR S_IWUSR
 #define LIBSSH2_SFTP_S_IRGRP S_IRGRP
@@ -722,10 +726,12 @@
                      LIBSSH2_SFTP_S_IFLNK) {
               line[0] = 'l';
             }
+#ifndef WIN32
             else if ((attrs.permissions & LIBSSH2_SFTP_S_IFMT) ==
                      LIBSSH2_SFTP_S_IFSOCK) {
               line[0] = 's';
             }
+#endif
             else if ((attrs.permissions & LIBSSH2_SFTP_S_IFMT) ==
                      LIBSSH2_SFTP_S_IFCHR) {
               line[0] = 'c';
@@ -746,21 +752,25 @@
             if (attrs.permissions & LIBSSH2_SFTP_S_IRGRP) {
               line[4] = 'r';
             }
+#ifndef WIN32
             if (attrs.permissions & LIBSSH2_SFTP_S_IWGRP) {
               line[5] = 'w';
             }
             if (attrs.permissions & LIBSSH2_SFTP_S_IXGRP) {
               line[6] = 'x';
             }
+#endif
             if (attrs.permissions & LIBSSH2_SFTP_S_IROTH) {
               line[7] = 'r';
             }
+#ifndef WIN32
             if (attrs.permissions & LIBSSH2_SFTP_S_IWOTH) {
               line[8] = 'w';
             }
             if (attrs.permissions & LIBSSH2_SFTP_S_IXOTH) {
               line[9] = 'x';
             }
+#endif
           }
           if (attrs.flags & LIBSSH2_SFTP_ATTR_SIZE) {
             currLen += snprintf(line+currLen, totalLen-currLen, "%11lld",

at least I can then successfully build a MingW32 bin which reports the features sftp and scp, and I was able to connect to my NetWare box then - however next error comes up if I try to transfer a file...
please give some hints how you did fix it with your MSVC build.

thanks, Guenter.
Received on 2007-01-25