4

The title more or less describes the problem I'm having on my Ubuntu box. I followed the following steps in installing libssh2, as given in the instructions:

./configure make make check (all 3 tests passed) sudo make install (I have to use sudo due to permissions)

I then try to use some of the examples given in libssh2 page and they all have the following:

#include "libssh2_config.h"

Which isn't found. The following 3 files are created in usr/local/include:

libssh2.h
libssh2_publickey.h
libssh2_sftp.h

Is there anything I am doing wrong?

Thank you!

ValtsBlukis
  • 458
  • 4
  • 11

3 Answers3

2

I still can't figure out why the file isn't created, but it is not really necessary, since removing the following #ifdefs:

#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

and simply replacing (on linux) with:

#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <arpa/inet.h>

as well as removing the rest of #ifdefs in the code solves the problem.

ValtsBlukis
  • 458
  • 4
  • 11
1

libssh2_config.h is in the example dir, you need to copy into your projects.

lixiaolong
  • 29
  • 1
0

There are libssh2_config.h files in the win32 dir, the vms dir and the os400 dir. You need to copy one of these into your projects.

dev0
  • 72
  • 5