Subject: Re: I want to know how to compile these source code under the libssh2/example?

Re: I want to know how to compile these source code under the libssh2/example?

From: Zhu Bicen <zhubicen_at_gmail.com>
Date: Wed, 2 Mar 2011 14:41:29 +0800

And I also tried this:
 bzhu_at_5M42X2X /usr/src/libssh2-1.2.5/example
$ gcc scp.c
scp.c:7:28: error: libssh2_config.h: No such file or directory
scp.c: In function ‘main’:
scp.c:39: error: storage size of ‘sin’ isn’t known
scp.c:81: error: ‘AF_INET’ undeclared (first use in this function)
scp.c:81: error: (Each undeclared identifier is reported only once
scp.c:81: error: for each function it appears in.)
scp.c:81: error: ‘SOCK_STREAM’ undeclared (first use in this function)
scp.c:87: error: invalid application of ‘sizeof’ to incomplete type ‘struct
sockaddr_in’

2011/3/2 Zhu Bicen <zhubicen_at_gmail.com>

> I'm newbie to use libssh2. I have installed the libssh2 by running the cygwin
> setup.exe.
> After that I found related files installed under dir /lib, and
> /usr/include.
> and the source of libssh2 had been installed under
> /usr/src/libssh2-1.2.5.tar.gz.
>
> From the doc of libssh2 website, I know the some example code is in the src
> tarball. so I extract the tarball.
>
> *Now I want to know how to compile these source code under the
> libssh2/example?*
> -rw-r--r-- 1 bzhu Domain Users 439 Feb 4 2010 Makefile.am
> -rw-r--r-- 1 bzhu Domain Users 22405 Mar 24 2010 Makefile.in
> -rw-r--r-- 1 bzhu Domain Users 8246 Mar 24 2010 direct_tcpip.c
> -rw-r--r-- 1 bzhu Domain Users 5997 Mar 24 2010 libssh2_config.h.in
> -rw-r--r-- 1 bzhu Domain Users 4464 Mar 24 2010 scp.c
> -rw-r--r-- 1 bzhu Domain Users 7373 Mar 24 2010 scp_nonblock.c
> -rw-r--r-- 1 bzhu Domain Users 5647 Mar 24 2010 scp_write.c
> -rw-r--r-- 1 bzhu Domain Users 6379 Mar 24 2010 scp_write_nonblock.c
> -rw-r--r-- 1 bzhu Domain Users 6920 Mar 24 2010 sftp.c
> -rw-r--r-- 1 bzhu Domain Users 8123 Mar 24 2010 sftp_RW_nonblock.c
> -rw-r--r-- 1 bzhu Domain Users 4497 Mar 24 2010 sftp_mkdir.c
> -rw-r--r-- 1 bzhu Domain Users 4685 Mar 24 2010 sftp_mkdir_nonblock.c
> -rw-r--r-- 1 bzhu Domain Users 7639 Mar 24 2010 sftp_nonblock.c
> -rw-r--r-- 1 bzhu Domain Users 5549 Mar 24 2010 sftp_write.c
> -rw-r--r-- 1 bzhu Domain Users 6221 Mar 24 2010 sftp_write_nonblock.c
> -rw-r--r-- 1 bzhu Domain Users 6193 Mar 24 2010 sftpdir.c
> -rw-r--r-- 1 bzhu Domain Users 6725 Mar 24 2010 sftpdir_nonblock.c
> -rw-r--r-- 1 bzhu Domain Users 7453 Mar 24 2010 ssh2.c
> -rw-r--r-- 1 bzhu Domain Users 6554 Mar 24 2010 ssh2_agent.c
> -rw-r--r-- 1 bzhu Domain Users 7866 Mar 24 2010 ssh2_exec.c
>
> Although I don't want to build the whole library,
> I have tried running the ./configure under the src top dir. But error
> occurs:
> bzhu_at_5M42X2X /usr/src/libssh2-1.2.5
> $ ./configure
> checking whether to enable maintainer-specific portions of Makefiles... no
> checking for sed... /usr/bin/sed
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for gawk... gawk
> checking whether make sets $(MAKE)... yes
> checking libssh2 version... 1.2.5
> checking build system type... i686-pc-cygwin
> checking host system type... i686-pc-cygwin
> configure: autobuild project... libssh2
> configure: autobuild revision... 1.2.5
> configure: autobuild hostname... 5M42X2X
> configure: autobuild timestamp... 20110302-143722
> checking for style of include used by make... GNU
> checking for gcc... gcc
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.exe
> checking for suffix of executables... .exe
> checking whether we are cross compiling... configure: error: in
> `/usr/src/libssh2-1.2.5':
> configure: error: cannot run C compiled programs.
> If you meant to cross compile, use `--host'.
> See `config.log' for more details.
>
>
> Thanks in advance.
>
> --
> Best Regards
> Bicen Zhu
>

-- 
Best Regards
Bicen Zhu

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