Ticket #81 (closed defect)

Opened 8 years ago

Last modified 7 years ago

Win32, static lib (using MinGW in MSYS shell)

Reported by: sisyphus_ Owned by: bagder
Priority: normal Milestone:
Component: Version:
Keywords: Cc: sisyphus_, bagder
Blocked By: Blocks:


I've just built a static libssh2-1.0 for native Win32 in the MSYS shell using the MinGW port of gcc-3.4.5. There were a couple of hoops to jump through:

In the configure script, I changed:

case "$host" in

LIBS="$LIBS -lws2_32"


case "$host" in

LIBS="$LIBS -lws2_32 -lgdi32"

That's just 2 changes; remove the -DLIBSSH2_WIN32 symbol, and add the link to libgdi32.a.

The removal of the -DLIBSSH2_WIN32 symbol may not be the correct thing to do if a dynamic lib is being built. (I couldn't build a dynamic lib.)

If LIBSSH2_WIN32 is defined, the example/simple executables apparently expect to link to a dynamic library, so fail to build, and 'make' dies.

In libssh2_priv.h I also changed the 'usleep' to 'usleep' to avoid a clash with the usleep function already defined in unistd.h. This (libssh2) function doesn't appear to be used anywhere, so I could possibly have just commented it out.

Thanks for the library !!


Change History

comment:1 Changed 8 years ago by bagder

Any chance you can make a "proper" patch for these suggested changes? And note that you modify configure.in, not the configure script itself.

comment:2 Changed 8 years ago by bagder

No feedback. Set to pending.

comment:3 Changed 8 years ago by sisyphus_

As per bagder's request for a proper patch to configure.in:

--- configure.in_orig Sat Feb 21 21:46:40 2009
+++ configure.in Sat Feb 21 21:46:32 2009
@@ -29,8 +29,8 @@

case "$host" in


  • LIBS="$LIBS -lws2_32"

+ LIBS="$LIBS -lws2_32 -lgdi32"




comment:4 Changed 7 years ago by sf-robot

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

Note: See TracTickets for help on using tickets.