Xcode4 Linking Problem. File was built for archive which is not the architecture being linked (arm6)

后端 未结 17 1363
别那么骄傲
别那么骄傲 2020-12-07 14:05

Recently, I switched to Xcode4 and when I compile my project I got following error.

ld: warning: ignoring file /Users/myname/Library/Developer/Xcode/DerivedD         


        
17条回答
  •  温柔的废话
    2020-12-07 14:28

    If I get the ignore file warning - I would run lipo -info on ignored file to find it's architecture as below

    lipo -info libTapkuLibrary.a
    

    That would print either of i386, armv6, armv7, armv7s, x86_64 etc. In general, that architecture has to match with your target build platform. E.g.

    • i386 = ios simulator or 32 bit build on mac os x
    • armv6 armv7 arm7s = ios device
    • x86_64 = 64 bit build on mac os x

    Depending on the mismatch, either you have to rebuild your library for your target platform or change your target platform.

    Note: For fat binaries, lipo -info will print a combination of above architectures.

提交回复
热议问题