ITADN

Build failure in linux

#277Opencsknns 创建于 2025-03-29
C
csknnscommented
Building in linux gives the following error ```Bash /home/x/Zip/Zip/Zip.swift:219:61: error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>') 217 | let readBytes = unzReadCurrentFile(zip, &buffer, bufferSize) 218 | if readBytes > 0 { 219 | guard fwrite(buffer, Int(readBytes), 1, filePointer) == 1 else { | |- error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>') | |- note: coalesce using '??' to provide a default when the optional value contains 'nil' | `- note: force-unwrap using '!' to abort execution if the optional value contains 'nil' 220 | throw ZipError.unzipFail 221 | } /home/x/Zip/Zip/Zip.swift:219:61: error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>') 217 | let readBytes = unzReadCurrentFile(zip, &buffer, bufferSize) 218 | if readBytes > 0 { 219 | guard fwrite(buffer, Int(readBytes), 1, filePointer) == 1 else { | |- error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>') | |- note: coalesce using '??' to provide a default when the optional value contains 'nil' | `- note: force-unwrap using '!' to abort execution if the optional value contains 'nil' 220 | throw ZipError.unzipFail 221 | } /home/x/Zip/Zip/Zip.swift:219:61: error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>') 217 | let readBytes = unzReadCurrentFile(zip, &buffer, bufferSize) 218 | if readBytes > 0 { 219 | guard fwrite(buffer, Int(readBytes), 1, filePointer) == 1 else { | |- error: value of optional type 'UnsafeMutablePointer<FILE>?' (aka 'Optional<UnsafeMutablePointer<_IO_FILE>>') must be unwrapped to a value of type 'UnsafeMutablePointer<FILE>' (aka 'UnsafeMutablePointer<_IO_FILE>') | |- note: coalesce using '??' to provide a default when the optional value contains 'nil' | `- note: force-unwrap using '!' to abort execution if the optional value contains 'nil' 220 | throw ZipError.unzipFail 221 | } ```
0 条评论