Ticket #102 (closed defect)

Opened 8 years ago

Last modified 8 years ago

Windows compile error with latest snapshot

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

Description

I sent this to the mail list but figured I post this bug as well.

The latest libssh2 snapshot has a few compiler errors with windows Visual Studio 2008:

1>hostkey.c
1>c:\users\giermang\new\libssh2-1.1\src\hostkey.c(445) : error C2491: 'libssh2_hostkey_hash' : definition of dllimport function not allowed
1>c:\users\giermang\new\libssh2-1.1\src\hostkey.c(468) : error C2491: 'libssh2_session_hostkey' : definition of dllimport function not allowed

I have tracked this down to an extra include of "libssh2.h" in both hostkey.c and knownhost.c. The below patch fixes the issue in Windows and still compiles in Linux as well:

--- src\hostkey.c 2009-05-20 08:08:43.000000000 -0500
+++ src\hostkey.c 2009-06-14 19:50:53.000000000 -0500
@@ -33,13 +33,12 @@

  • WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  • NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  • USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  • OF SUCH DAMAGE. */


-#include "libssh2.h"

#include "libssh2_priv.h"
#include "misc.h"


/* Needed for struct iovec on some platforms */ #ifdef HAVE_SYS_UIO_H #include <sys/uio.h>

--- src\knownhost.c 2009-06-10 21:02:03.000000000 -0500
+++ src\knownhost.c 2009-06-14 19:51:21.000000000 -0500
@@ -33,13 +33,12 @@

  • WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  • NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  • USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  • OF SUCH DAMAGE. */


-#include "libssh2.h"

#include "libssh2_priv.h"
#include "misc.h"


struct known_host {

struct list_node node;
char *name; /* points to the name or the hash (allocated) */

Change History

comment:1 Changed 8 years ago by bagder

Thanks for your report and help in improving libssh2!

A fix has just been committed to the source code repo, this case is now considered fixed and closed!

Note: See TracTickets for help on using tickets.