Subject: [libssh2] #171: test program ssh2.c fails to compile under Windows XP

[libssh2] #171: test program ssh2.c fails to compile under Windows XP

From: libssh2 Trac <trac_at_libssh2.stuge.se>
Date: Tue, 18 May 2010 22:10:52 -0000

#171: test program ssh2.c fails to compile under Windows XP
-------------------------+--------------------------------------------------
 Reporter: dchang92606 | Owner:
     Type: defect | Status: new
 Priority: normal | Milestone: 1.2.6
Component: tests | Version: 1.2.4
 Keywords: | Blocks:
Blocked By: |
-------------------------+--------------------------------------------------
 When compiling ssh2.c using Visual Studio 2005, I get this error...

 ssh2.c
 ssh2.c(60) : error C2220: warning treated as error - no 'object' file
 generated
 ssh2.c(60) : warning C4996: 'strdup' was declared deprecated
         c:\Program Files\Microsoft Visual Studio
 8\VC\INCLUDE\string.h(205) : see declaration of 'strdup'
         Message: 'The POSIX name for this item is deprecated. Instead, use
 the ISO C++ conformant name: _strdup. See online help for details.'

 Looking on line 60, here is the code:

         responses[0].text = strdup(password);

 It's the only occurrence of strdup() in this program. Thus, I recommend
 something like this in a header file...

 #ifdef _WIN32
 #define strdup _strdup
 #endif

 DC

-- 
Ticket URL: <http://libssh2.stuge.se/ticket/171>
libssh2 <http://libssh2.stuge.se/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-05-19