Error:Apple Mach-O Linker (Id) Warning

若如初见. 提交于 2020-01-11 08:14:06

问题


In my app I have been working to import and export the database.

I have imported some files which is required for this functionality but when i try to run the app in simulator the errors listed below occurs. I can't understand which type of errors are these. so plz help me solve this problem.

Undefined symbols for architecture i386:
  "_inflateInit2_", referenced from:
      -[NSData(NSDataExtension) gzipInflate] in NSData+CocoaDevUsersAdditions.o
  "_inflate", referenced from:
      -[NSData(NSDataExtension) gzipInflate] in NSData+CocoaDevUsersAdditions.o
  "_inflateEnd", referenced from:
      -[NSData(NSDataExtension) gzipInflate] in NSData+CocoaDevUsersAdditions.o
  "_deflateInit2_", referenced from:
      -[NSData(NSDataExtension) gzipDeflate] in NSData+CocoaDevUsersAdditions.o
  "_deflate", referenced from:
      -[NSData(NSDataExtension) gzipDeflate] in NSData+CocoaDevUsersAdditions.o
  "_deflateEnd", referenced from:
      -[NSData(NSDataExtension) gzipDeflate] in NSData+CocoaDevUsersAdditions.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

回答1:


You didn't include the libz.tbd where those functions are. Select the project node, select your target, go to the Build Phases tab, expand "Link Binaries With Libraries", add libz.dylib, and try again.




回答2:


Add libz.dylib to your framework, it will work..




回答3:


I faced the same issue, and thanks to Jano, it was resolved after I added the Libz.dylib to the project.



来源:https://stackoverflow.com/questions/7752127/errorapple-mach-o-linker-id-warning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!