You are probably better off not using the code from the git repository for the reason that those headers won't match the code for libssh
that's actually installed on your system.
So I'd recommend reversing the changes you made (delete the files or symlinks you copied or created) and instead installing the development parts using apt
. You can find out which header files were installed by doing this:
rpm -ql libssh-dev
On my system (Fedora) the package is actually called libssh-devel
. When I run
rpm -ql libssh-devel
I get the following output (partial)
/usr/include/libssh/callbacks.h
/usr/include/libssh/legacy.h
/usr/include/libssh/libssh.h
/usr/include/libssh/server.h
/usr/include/libssh/sftp.h
/usr/include/libssh/ssh2.h
/usr/lib64/cmake/libssh-config-version.cmake
/usr/lib64/cmake/libssh-config.cmake
/usr/lib64/libssh.so
/usr/lib64/libssh_threads.so
...
As you can see, the libssh.h
header is in the libssh
directory, so from your code you'd use
#include <libssh/libssh.h>
Using that method will better assure that the headers you have installed will match the libraries you have installed and save many frustrating hours later.
Here's a quick test program you can use to make sure it's really working:
// sshtest.cpp
#include <iostream>
#include <libssh/libssh.h>
int main()
{
std::cout << ssh_copyright() << std::endl;
return 0;
}
Compile, link and run:
g++ -o sshtest sshtest.cpp -lssh
./sshtest
This should produce the copyright string which starts with the libssh
version number so you can verify that it matches the version you expected.
On my machine just now, that produced the following output:
0.6.3 (c) 2003-2014 Aris Adamantiadis, Andreas Schneider, and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights
Good luck.