Problems trying to add the libz.1.2.3.dylib to my ipad project

江枫思渺然 提交于 2019-12-13 03:41:16

问题


First of all, i'm now on this site so really sorry if i'm commiting some error posting this question.I'm trying to use the zipArchive class to manage zip files in an ipad project.

What steps will reproduce the problem?

  1. Create a project.

  2. Add the ZipArchive folder with their files.

  3. Add the libz.1.2.3.dylib

What is the expected output? What do you see instead?

I have all the code (about ziparchive) commented, so i only have the #import #import "ZipArchive/ZipArchive.h" in my viewcontroller, and i expect to build the project without errors.

I see the following error in the compiler:

ld: warning: ignoring file /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libSystem.dylib, missing required architecture i386 in file ld: in /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2/Symbols/usr/lib/libobjc.A.dylib, missing required architecture i386 in file for architecture i386 collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

What version of the product are you using? On what operating system? I'm using xcode 4 a project for the ipad with the 4.2 ipad simulator on a Mac os X version 10.6.7

Please provide any additional information below. I think the problem is with the libz.1.2.3.dylib library, and I have some guest of where might be the problem:

  1. The libz.1.2.3.dylib path error is on iPhoneSimulator.platform, it is valid for ipad too?? If is not, which lib could i use for the same purpose with the ipad??

  2. I'm not sure i'm adding the libz.1.2.3.dylib lib correctly. What I have done is: right-click on Resources folder -> add files to "myproject" -> search for the libz.1.2.3.dylib and add the 4.2 version of it from the path u could see in the compiler errors. I also try to add to the frameworks folder with the same results.

I'm reading lots of posts about how to fix similar problems but no one could help me.

Any idea of what I have to do to fix my problem??

Really thanks!!


回答1:


You need to do this:

  1. Delete libz.1.2.3 from your local Frameworks folder. You don't need it.
  2. Select your project at the top of the Project Navigator.
  3. Select your application target.
  4. Open "Link Binary With Libraries".
  5. Click the "+"
  6. Search for "libz".
  7. Select "libz.dylib".

If you are using Xcode 4.5.2 the screenshots below may aide you in proceeding through steps 2 through 5. I'm not sure if other versions of Xcode are the same or not.




回答2:


If you are using xcode 4 or upper version of it than it seems that libz.1.2.3.dylib is not included in iOS5 sdk. Here is simple method to fix this:

  1. Open your project in XCode 4.2

  2. Remove libz.1.2.3.dylib from framework

  3. Add new framework libz.1.2.5

  4. Run you app

It works fine.




回答3:


libz.dylib is an alias to the latest version (currently libz.1.2.5) so you can also navigate to the file's location in Terminal and create a symlink called "libz.1.2.3.dylib".

cd /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/

sudo ln -s libz.1.2.5.dylib libz.1.2.3.dylib

You could also link to libz.dylib, which I would expect to always point to the actual latest version, which is why Tricon recommends changing the project to just include libz.dylib. I'm not sure I'd delete anything, although it's not a whole lot different from adding a new symlink...you're still mucking around deep inside the guts of Xcode....



来源:https://stackoverflow.com/questions/5662737/problems-trying-to-add-the-libz-1-2-3-dylib-to-my-ipad-project

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