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

Re: libssh Installation


Compiling libssh in Windows:

Download latest version using git:
git clone https://git.libssh.org/projects/libssh.git libssh

Download and install visual studio community 2017
<https://visualstudio.microsoft.com/downloads/> and Cmake
<https://github.com/Kitware/CMake/releases/download/v3.14.0-rc1/cmake-3.14.0-rc1-win64-x64.msi>
.

libssh has some dependencies. The most important one is OpenSSL. You can
get the precompiled headers form here
<https://www.npcglib.org/~stathis/blog/precompiled-openssl/>. Make sure you
download the VS2017 one.

Now you are ready to create the project that you will be able to compile in
VS.

cd libssh
mkdir build
Now open cmake GUI and just set:
source to your libssh path
where to build to the just created build path

And click configure.

Here is a screenshot of my CMake configuration. Make sure you uncheck
WITH_ZLIB (unless you compile it by your own) and set LIB_EAY_RELEASE
to libcryptoMT.lib path and SSL_EAY_RELEASE to libsslMT.lib.

[image: 2019-02-07 16_49_07-Request - agarciaillera@xxxxxxxxx - Gmail.png]

Now you can click on generate and open the project. It will open it up in
VS2017.

Lastly, in VS you should right click on ssh_static (or ssh_shared if you
want to generate a dll) at the Solution Explorer at the right -> properties
-> C/C++ -> Code Generation -> Runtime Librariy -> /MT

and  properties -> C/C++ -> Preprocessor -> Preprocessor definitions ->
properties -> C/C++ -> add HAVE_OPENSSL_CRYPTO_CTR128_ENCRYPT;

Make sure that you select the Configuration (Debug, release...) that you
want to build the library in.

Just right click again in the project name and click on Build.

You will have a .lib (if you built the static version) or a .lib and .dll (
in the case you built the shared one).

You can include those libs plus the include folder in your project and
start using libssh.


Let me know it it is clear enough

On Thu, Feb 7, 2019 at 10:57 AM Alberto Garcia <agarciaillera@xxxxxxxxx>
wrote:

> You are mixing things:
>
> You don't need CMake to compile a simple C program. But for your program
> to use libssh your first need to compile libssh which project is generated
> using CMake.
>
>
> On Thu, Feb 7, 2019 at 1:06 AM Andreas Schneider <asn@xxxxxxxxxxxxxx>
> wrote:
>
>> On Wednesday, February 6, 2019 8:50:54 PM CET Alberto Garcia wrote:
>> > I just used cmake with openssl(you can get the precompiled libs from
>> here
>> > https://www.npcglib.org/~stathis/blog/precompiled-openssl/) and zlib (I
>> > compiled that myself but zlib is optional, you can skip it if you want).
>>
>> Our Windows CI machine uses
>>
>> vcpkg install openssl zlib
>>
>> to compile libssh.
>>
>> --
>> Andreas Schneider                 asn@xxxxxxxxxxxxxx
>> GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
>>
>>
>>
>
> --
> Alberto García Illera
>
> GPG Public Key <https://goo.gl/yshdwh>
>


-- 
Alberto García Illera

GPG Public Key <https://goo.gl/yshdwh>

PNG image


Follow-Ups:
Re: libssh InstallationAndreas Schneider <asn@xxxxxxxxxxxxxx>
References:
Re: libssh InstallationAlberto Garcia <agarciaillera@xxxxxxxxx>
Re: libssh InstallationAlberto Garcia <agarciaillera@xxxxxxxxx>
Re: libssh InstallationAndreas Schneider <asn@xxxxxxxxxxxxxx>
Re: libssh InstallationAlberto Garcia <agarciaillera@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org