iPhone library: file is not of required architecture

前端 未结 3 1150
囚心锁ツ
囚心锁ツ 2021-01-22 14:43

I have searched for hours however I still have no clue what is wrong with my configuration. My project uses a self-written libray (myLib). This library is compiled to work

相关标签:
3条回答
  • 2021-01-22 14:55

    I've met the same problem too. But seems you don't need to drag two .a files into the app project to solve this problem. This is what I did:

    1. Drag the static library project into app project's framework group
    2. "Get Info" for the target in app project
    3. Set the direct dependency of static library
    4. Make clean all unnecessary builds(for example the simulator build) in the static library project
    5. Build in the app project
    0 讨论(0)
  • 2021-01-22 15:07

    You need to compile your library for Intel so the Simulator can use it (which I gather you have done already), and then compile it for ARM, so it can run on the iPhone. Then you have to merge the two libraries. There are different ways to accomplish that, or make it more automatic.

    Here are some links to help you:

    http://blog.stormyprods.com/2008/11/using-static-libraries-with-iphone-sdk.html http://www.clintharris.net/2009/iphone-app-shared-libraries/

    0 讨论(0)
  • 2021-01-22 15:13

    You need to add both .a files,the one built for the device (build/$config-iphoneos)and the one built for the sim (build/$config-iphonesimulator) to the new project. Make sure you name them differently before dropping them in. This is how admob and similar offering ship their static libs.

    0 讨论(0)
提交回复
热议问题