pult / libssh2_delphi

delphi pascal libssh2 ssh2 sftp libssh2.dll
81 stars 30 forks source link

Module not found in Library libssh2.dll; Function libssh2_exit #10

Closed rosch100 closed 4 years ago

rosch100 commented 4 years ago

When I call TSFTPClient.Create, an exception is thrown in the constructor of TSSH2Client at: if InterlockedIncrement(GSSH2Init) = 1 then The error is:

Module not found
Library: libssh2.dll
Function: libssh2_exit

I'm using the libssh2.dll from the bin directory (Version from 2016-11-02). Also, the 32bit example Project1_d11.exe throws an error "Could not find the library: "libssh2.dll" (%1 is not a valid Win32 application).

pult commented 4 years ago

for 32 bit:

  unpack "libssh2.dll.x86.7z" and 
    libeay32.dll
    libssh2.dll
    ssleay32.dll
rosch100 commented 4 years ago

That's, what I did. All dll's are present in the apps path.

I'm using the libssh2.dll from the bin directory (Version from 2016-11-02).

pult commented 4 years ago

i had no such problem. I think you need to watch your process and analyze which library you downloaded (sys internals process explorer ... view loaded libraries)

ChinaID commented 4 years ago

I got the same issue, but x64 works fine.

pult commented 4 years ago

try downloading "libssh2.dll" at the start of your application: SafeLoadLibrary(sLibPath+'\'+'libssh2.dll');