[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error while compiling code give on http://api.libssh.org/master/libssh_tutor_guided_tour.html


In continuation to my previous mail, below is the output of shared library dependencies info of the code I compiled after commenting show_remote_processes function:
# ldd a.out 	linux-vdso.so.1 =>  (0x00007fff8739a000)	libssh.so.4 => /usr/lib/libssh.so.4 (0x00007fe0db935000)	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe0db5a0000)	libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fe0db385000)	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fe0db16a000)	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe0daf62000)	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fe0dad49000)	libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x00007fe0daaf6000)	libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x00007fe0da767000)	/lib64/ld-linux-x86-64.so.2 (0x00007fe0dbb96000)	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe0da548000)	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe0da344000)
Sunil Datta
--- On Thu, 18/10/12, sunil datta <sunil_prog@xxxxxxxxx> wrote:

From: sunil datta <sunil_prog@xxxxxxxxx>
Subject: error while compiling code give on http://api.libssh.org/master/libssh_tutor_guided_tour.html
To: libssh@xxxxxxxxxx
Date: Thursday, 18 October, 2012, 8:21 AM

Hello,
I tried the example give on the link http://api.libssh.org/master/libssh_tutor_guided_tour.html
I am facing problem compiling code when I add the function show_remote_processes mentioned on the said page. I am getting the following error:
# gcc test.c  -l sshtest.c: In function ‘show_remote_processes’:test.c:13:11: warning: assignment makes pointer from integer without a
 cast/tmp/ccYlVHrp.o: In function `show_remote_processes':test.c:(.text+0x31): undefined reference to `ssh_channel_new'test.c:(.text+0x62): undefined reference to `ssh_channel_open_session'test.c:(.text+0x85): undefined reference to `ssh_channel_free'test.c:(.text+0xa9): undefined reference to `ssh_channel_request_exec'test.c:(.text+0xcc): undefined reference to `ssh_channel_close'test.c:(.text+0xe0): undefined reference to `ssh_channel_free'test.c:(.text+0x110): undefined reference to `ssh_channel_read'test.c:(.text+0x151): undefined reference to `ssh_channel_close'test.c:(.text+0x165): undefined reference to `ssh_channel_free'test.c:(.text+0x191): undefined reference to `ssh_channel_read'test.c:(.text+0x1b8): undefined reference to `ssh_channel_send_eof'test.c:(.text+0x1cc): undefined reference to
 `ssh_channel_close'test.c:(.text+0x1e0): undefined reference to `ssh_channel_free'collect2: ld returned 1 exit status

Below is the result of whereis command:#whereis libssh.hlibssh: /usr/lib/libssh2.a /usr/lib/libssh.so /usr/lib/libssh2.so /usr/lib64/libssh2.a /usr/lib64/libssh.so /usr/lib64/libssh2.so /usr/include/libssh /usr/include/libssh2.h
Following is the information about my OS:# uname -aLinux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

I tried google but failed to find the reason for this.
Regards,

Sunil Datta


Archive administrator: postmaster@lists.cynapses.org