第三方庫“zip achieve”,報錯:Undefined symbols for architecture x86_64: "_deflate", referenced from: _zipWriteInFileInZip in zip.o _zipCloseFileInZipRaw64 in zip.o......

『導言』

今天,研究了下ZipArchive第三方壓縮解壓縮框架,拖入框架后出9個錯誤提示:

圖,錯誤提示
  • 錯誤提示代碼:
Undefined symbols for architecture x86_64:
  "_deflate", referenced from:
      _zipWriteInFileInZip in zip.o
      _zipCloseFileInZipRaw64 in zip.o
  "_deflateInit2_", referenced from:
      _zipOpenNewFileInZip4_64 in zip.o
  "_inflate", referenced from:
      _unzReadCurrentFile in unzip.o
  "_get_crc_table", referenced from:
      _unzOpenCurrentFile3 in unzip.o
      _zipOpenNewFileInZip4_64 in zip.o
  "_inflateEnd", referenced from:
      _unzCloseCurrentFile in unzip.o
  "_crc32", referenced from:
      _unzReadCurrentFile in unzip.o
      _zipWriteInFileInZip in zip.o
  "_deflateEnd", referenced from:
      _zipCloseFileInZipRaw64 in zip.o
  "_inflateInit2_", referenced from:
      _unzOpenCurrentFile3 in unzip.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
  • 重點:用zip achieve這個庫需要導入libz.tdb
  • 方法一:

點擊Project——>Targets——>``build phrase——>Linked frameworks and Libraries——>“+”——>搜索“libz.”---->雙擊“libz.tdb”——>command+R`

圖.方法一添加過程
  • 方法二:

點擊Project ——>Targets——>General——>Link binary with Library——>“+”——>搜索“libz.”---->雙擊“libz.tdb”——>command+R

圖.方法二添加過程

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容