SwiftSH icon indicating copy to clipboard operation
SwiftSH copied to clipboard

Xcode 12 / Swift 5 - Build Errors

Open matthewlprice opened this issue 5 years ago • 2 comments
trafficstars

Swift Compiler Error Group ~/SSHCommands.swift:15:5: Value of optional type 'SSHShell<Libssh2>?' must be unwrapped to refer to member 'withCallback' of wrapped base type 'SSHShell<Libssh2>' ~/SSHCommands.swift:26:5: Value of optional type 'SSHShell<Libssh2>?' must be unwrapped to refer to member 'write' of wrapped base type 'SSHShell<Libssh2>' ~/SSHCommands.swift:32:5: Value of optional type 'SSHShell<Libssh2>?' must be unwrapped to refer to member 'disconnect' of wrapped base type 'SSHShell<Libssh2>' ~/SSHCommands.swift:32:22: Missing argument for parameter #1 in call ~//Pods/SwiftSH/SwiftSH/Libssh2.swift:333:119: Value of optional type 'UnsafePointer<Int8>?' must be unwrapped to a value of type 'UnsafePointer<Int8>'

This is in a fresh project just to test before implementing in my working project. I changed the swift version from 5 to 4.2 then to 4 and got this error:

~/Pods/SwiftSH/SwiftSH/Libssh2.swift:333:119: Value of optional type 'UnsafePointer<Int8>?' must be unwrapped to a value of type 'UnsafePointer<Int8>'

matthewlprice avatar Jun 25 '20 01:06 matthewlprice

for compile change at ligne 333

let response = LIBSSH2_USERAUTH_KBDINT_RESPONSE(text: strdup(password), length: UInt32(strlen(password!)))

stephaneworkspace avatar Aug 28 '20 21:08 stephaneworkspace

Can the author update the library to solve the problem on swift5? Although I already know how to solve it, it's still troublesome to modify it every time.

iOSbug avatar Nov 09 '21 02:11 iOSbug