www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: Compile libssh2 on Linux

Re: Compile libssh2 on Linux

From: Peter Stuge <peter_at_stuge.se>
Date: Wed, 1 Jul 2020 16:04:25 +0000

Bruno Buzzi Brassesco wrote:
> What is the logic behind the version number of the project and library ?

The project version is more or less aesthetical - it's for humans and
it is not guaranteed to have technical meaning.

The library file suffix numbers are generated by libtool, and project
developers have a duty to instruct libtool such that these numbers do
have technical meaning, specifically, as long as maintainers do this
job correctly (as is the case in libssh2) dynamically linked
applications work correctly even if they are execute on systems with
different versions (both project and .so file) than were used at link
time. Some search phrases are "API vs. ABI difference" and "SONAME version".

This may seem complicated, the good news is that library users don't
need to care about this, and IMO should not.

I strongly recommend to use pkg-config in your build system.

Run pkg-config --atleast-version=1.9.0 libssh2 in the build system to
detect whether libssh2 in your required version is available at build time.

Use pkg-config --cflags libssh2 and pkg-config --libs libssh2 to get the
CFLAGS and LIBS/LDFLAGS needed to compile for and link with libssh2.

The SONAME versioning can be treated as an operating system detail.

libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2020-07-01

the libssh2 team