[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libssh-0.6.4 Connection to server and build problem
[Thread Prev] | [Thread Next]
- Subject: Re: libssh-0.6.4 Connection to server and build problem
- From: Andreas Schneider <asn@xxxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Thu, 25 Dec 2014 12:40:02 +0100
- To: libssh@xxxxxxxxxx
On Wednesday 24 December 2014 15:29:53 Виктор Буцких wrote: > Hello Hi, > I use your perfect library for my project on Windows. > I decide to migrate from libssh 0.4.8 to 0.6.4. > I don't use pre-compiled library (prefer to build myself). > For building libssh I use VisualStudio 2010 Express (static build). > > I've built libssh with following environmental: > Windows 7 32 bit > zlib - 1.2.8 > openssl - 1.0.1j > > I haven't got any problem with libssh-0.4.8 but with libssh I have two > problem > > 1) When I try to build libssh I've got following error: > sftp.obj : error LNK2019: unresolved external symbol _htonll referenced in > function _buffer_add_attributes > sftp.obj : error LNK2019: unresolved external symbol _ntohll referenced in > function _sftp_parse_attr_4 > > I've fixed this error comment > //#ifndef HAVE_HTONLL > in misc.c and misc.h > patch is attached Check the cmake configure run, it detected htonll() so it is available on your system. The question is which header do we need to include and which library needs to be linked. Can you try to figure that out? It works just fine for me with Windows 8.1 and Visual Studio 2013. > 2) After fix this error I build my program successfull, but I got > problem with connect to ssh server. When I call ssh_connect(session) I got > error *Failed to connect: No error*. > I try to learn your source code and found interesting thing: > > rc = connect(s, itr->ai_addr, itr->ai_addrlen); > if (rc == -1 && (errno != EINPROGRESS)) { > ssh_set_error(session, SSH_FATAL, > "Failed to connect: %s", strerror(errno)); > ssh_connect_socket_close(s); > s = -1; > continue; > } > It's really interesting situation: > Cuz we use nonblocking socket our connect function return -1 but connect > successful done and *errno=0*. > I've fixed this error too (complex patch arrached to e-mail) I've fixed that in the master and v0-6 branch for now. Thanks! -- andreas
libssh-0.6.4 Connection to server and build problem | Виктор Буцких <brainvictor777@xxxxxxxxx> |