On Thursday, 30 December 2021 17:45:51 CET Mason Hieb wrote: > Hi, I'm a complete newbie to this library, and was *really* struggling to > get the tutorial to work for me because I kept getting the "Library Not > Initialized" error but couldn't understand why. > > I discovered - after much frustration and searching - that because I'm > statically linking the library, I need to add "ssh_init()" to the start of > my program (and "ssh_finalize()" at the end). The tutorial assumes a > dynamic build. > > I humbly recommend, from my newbie perspective, that it might be good to > mention this in Chapter 1 of the tutorial ("if you are using a static > library build of sshlib, then you must add these functions" etc)
ssh_init() is called automatilly when you use the shared library. We do not prefer that people statically link libssh as they often don't understand the implications. https://tldrlegal.com/license/gnu-lesser-general-public-license-v2.1-(lgpl-2.1)