Skip to content

pchaseh/qlibssh2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qlibssh2

Qt wrapper for libssh2

Usage

Compilation

Build and install libssh2:

git clone https://github.com/libssh2/libssh2.git
cd libssh2
mkdir build
cmake -DCRYPTO_BACKEND=WinCNG -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=./build .
cmake --build . --target install

Create the path 3rdparty/libssh2 in the project's directory and add the following:

  • lib/libssh2.lib
  • include/libssh2.h

Build qlibssh2:

qmake
make

To use it in one of your projects, link it as follows:

LIBS += -L$$PWD/3rdparty/qlibssh2/lib -lqlibssh2

INCLUDEPATH += $$PWD/3rdparty/qlibssh2/include

API

#include "Ssh2Client.h"

#include <QtCore/QCoreApplication>

using namespace qlibssh2;

int main(int argc, char *argv[])
{
    QCoreApplication app{argc, argv};

    Ssh2Settings settings;
    Ssh2Client client{settings};

    QObject::connect(&client, &Ssh2Client::sessionStateChanged, [](Ssh2Client::SessionStates state) {
        qDebug() << "state" << state;
    });
    client.connectToHost("[email protected]");

    return app.exec();
}

About

Qt wrapper around libssh2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.3%
  • QMake 1.4%
  • C 0.3%