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

Re: Statically linking


It seems you are not linking OpenSSL properly. Are you sure you are doing
it right?

Even if you link with a static libssh you need to still link with a static
openssl if you want to have it compiled.

Cheers

On Sat, Apr 13, 2019 at 4:36 PM Mihai Moldovan <ionic@xxxxxxxx> wrote:

> * On 4/12/19 9:28 PM, Paul Beerkens wrote:> [...]
> > I am getting tons of error messages about undefined reference like these:
> >
> >     /usr/local/lib/libssh.a(pki.c.o): In function `ssh_key_clean':
> >     /home/paul.beerkens/Downloads/libssh-0.8.7/src/pki.c:136: undefined
> >     reference to `DSA_free'
> >     /home/paul.beerkens/Downloads/libssh-0.8.7/src/pki.c:137: undefined
> >     reference to `RSA_free'
> >     /home/paul.beerkens/Downloads/libssh-0.8.7/src/pki.c:139: undefined
> >     reference to `EC_KEY_free'
> >     /usr/local/lib/libssh.a(pki.c.o): In function `ssh_signature_free':
> >     /home/paul.beerkens/Downloads/libssh-0.8.7/src/pki.c:505: undefined
> >     reference to `DSA_SIG_free'
> >     /home/paul.beerkens/Downloads/libssh-0.8.7/src/pki.c:521: undefined
> >     reference to `ECDSA_SIG_free'
> >     /usr/local/lib/libssh.a(wrapper.c.o): In function `crypto_free':
> >
> >
> >
> > What do I need to do to get static linking to work?
>
> Interesting. Note that a full build log is always a nice thing to provide
> because at that point in time, we can tell you what went wrong, but not
> exactly why.
>
> The underline issue is that your crypto-backend is not linked in - which
> seems
> to be OpenSSL in your case (yes, libssh supports multiple backends, it
> needn't
> be OpenSSL.)
>
> The reason *why* this is not automatically pulled in correctly is because
> you
> just linked libssh manually, leading to said problems. I think (but am not
> 100 %
> positive) that libssh provides a libssh_static.pc file which can be used
> exactly
> for this case and includes the dependent libraries.
>
>
>
> Mihai
>
>

-- 
Alberto García Illera

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

References:
Statically linkingPaul Beerkens <paul.beerkens@xxxxxxxxxxxxxxxxxxxx>
Re: Statically linkingMihai Moldovan <ionic@xxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org