xcode 错误:Apple Mach-O 链接器 (Id) 警告
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7752127/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error:Apple Mach-O Linker (Id) Warning
提问by iPhone
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
回答by Jano
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.
您没有在这些函数所在的位置包含 libz.tbd。选择项目节点,选择您的目标,转到 Build Phases 选项卡,展开“Link Binaries With Libraries”,添加 libz.dylib,然后重试。
回答by Dhaval H. Nena
Add libz.dylib to your framework, it will work..
将 libz.dylib 添加到您的框架中,它将起作用。
回答by Ahmed Elazab
I faced the same issue, and thanks to Jano, it was resolved after I added the Libz.dylib to the project.
我遇到了同样的问题,感谢 Jano,在我将 Libz.dylib 添加到项目后解决了这个问题。