Subject: Issues with using LibSSH2

Issues with using LibSSH2

From: Kalyan Polasi <kalyan.polasi_at_netenrich.com>
Date: Wed, 31 Mar 2010 08:27:13 -0700

Hello Team,

We have a requirement to do Port-forwarding. For that we thought of using LibSSH2.

We tried to compile the LIBBSSH2 source code of the version 2-0.9, which we are able to do it successfully after adding the external libraries from OpenSSL and zLib.

Now we have release version libssh2.lb file.

After that we tried to start with the example "direct_tcpip.c" which is available in the site. But whenever we tried to call any of the libssh2 definitions, we are getting into linker errors, which we were not getting the solution to fix this.

I am pasting the code and the errors below for your reference:

/*Didn't pasted the header files information here, which are same as the example in the site*/
int main(int argc, char *argv[])
{
    int rc;
    LIBSSH2_SESSION *session;
#ifdef WIN32
    char sockopt;
    WSADATA wsadata;
    WSAStartup(MAKEWORD(2,0), &wsadata);
#else
    int sockopt;
#endif
    rc = libssh2_init (0);
    /* Create a session instance */
    session = libssh2_session_init();
}

1. If I try to call the function "libssh2_init(0);", I am getting the below error

      "Error 2 error C3861: 'libssh2_init': identifier not found"

2. And if I try to call the function "libssh2_session_init()", I am getting linker error as shown below.

               "Error 4 error LNK2001: unresolved external symbol "struct _LIBSSH2_SESSION * __cdecl libssh2_session_init_ex(void * (__cdecl*)(unsigned int,void * *),void (__cdecl*)(void *,void * *),void * (__cdecl*)(void *,unsigned int,void * *),void *)" (?libssh2_session_init_ex@@YAPAU_LIBSSH2_SESSION@@P6APAXIPAPAX_at_ZP6AXPAX0@ZP6APAX2I0_at_Z2@Z)"

This is the case for whatever function I call from my example program.
Please help us in getting this issue fixed.

We are using VS2005 on Windows XP Professional.

Regards,
Kalyan.Polasi
P Please consider the environment before printing this e-mail.

--------------------------------------------------
Confidentiality And Disclaimer Notice
Please do not print this email unless it is absolutely necessary. The
information contained in this electronic message and any attachments to this
message are intended for the exclusive use of the addressee(s) and may contain
proprietary, confidential or privileged information. If you are not the intended
recipient, you should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately and destroy all copies of this message and any
attachments. WARNING: Computer viruses can be transmitted via email. The
recipient should check this email and any attachments for the presence of
viruses. The company accepts no liability for any damage caused by any virus
transmitted by this email. &hellip;&hellip;www.netenrich.com
-------------------------------------------------

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-03-31