Subject: Re: LIBSSH2-DEV C++ Integration issue [Linker error] undefined reference to `libssh2_

Re: LIBSSH2-DEV C++ Integration issue [Linker error] undefined reference to `libssh2_

From: Ivan Pechorin <ivan.pechorin_at_gmail.com>
Date: Sat, 10 Sep 2011 20:30:45 +0400

2011/9/10 AL-AMEEN MUTHALIF <ameen_al_at_rediffmail.com>

>
> Iím trying to integrate libssh2 libraries(windows version libssh2-1.2.5)
> with Dev-C++( v4.9.9.2). The OS is Windows XP SP3. Iím facing the
> following error when I compile the test file ssh2_exec.c (built in example)
> file.
>
> **
>
> ** **
>
> *Compiler Output:*
>
> *---------------------*
>
> [Linker error] undefined reference to `libssh2_session_block_directions'
> ****
>
> [Linker error] undefined reference to `select_at_20'****
>
> [Linker error] undefined reference to `WSAStartup_at_8'****
>
> [Linker error] undefined reference to `libssh2_init'****
>
>
It looks like you didn't specify any libraries to link against.

> LIBS = -L"C:/Dev-Cpp/lib" -L"C:/MyApps/libssh2-1.2.5/lib"
>

Try adding the necessary libraries ("-lssh2 -lws2_32") to the end of LIBS:

LIBS = -L"C:/Dev-Cpp/lib" -L"C:/MyApps/libssh2-1.2.5/lib" -lssh2 -lws2_32

P.S. I didn't use gcc on Win32, so I'm not sure what's the proper way of
linking against the WinSock2 (ws2_32.dll) here.

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-09-10