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

后端 未结 17 1373
别那么骄傲
别那么骄傲 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:37

    None of these answers worked for me. (Similar warning message, different static library project). For me it was having configured XCode to honor the build directories of the targets and then having targets build in a local build/ directory that caused the problem. Configuring XCOde to use "Derived data" folder fixed it.

    0 讨论(0)
  • 2020-12-07 14:38

    Had the same problem. But the reason was different I suppose. I was using the library.a file built for simulator and trying to run it on device.. came to know that i need different .a files for simulator and device. I hope this helps someone ;)

    For example, here I have imported different library files for device and simulator

    0 讨论(0)
  • 2020-12-07 14:39

    I was able to solve this problem by doing the opposite of the accepted answer - I changed the 'Build Active Architecture Only' from NO to YES.

    0 讨论(0)
  • 2020-12-07 14:44

    Try to remove the armv6 architecture, and compile it only for armv7.

    0 讨论(0)
  • 2020-12-07 14:46

    This worked for me :

    1. Click on the offending framework's 'Project' file (xcodeproj).

    2. Go to the "Info" tab for the framework's 'Project' (not 'Target').

    3. Expand 'Configurations' and make sure that both 'Debug' and 'Release' have 2 configurations set--one for the framework's 'Project' and another for the framework's 'Target'. In the case of frameworks the 'Target' compiles to a Library and not an application, so it's easy to get confused.

    4. 'Debug' should have the Project set to 'Debug' and the Library set to 'Shared'

    5. 'Release' should have the Project set to 'Release' and the Library set to 'Shared'

    6. Compile, run, and enjoy.

    7. If you ended up mangling your entire project trying to figure this out, then you might want to double-check your Application's Project build phases (as Gon suggested). The Library should be there highlighted in red, even if it doesn't exist on your drive. If not, as long as it's set to 'Shared' you should be able to add it back again.

    8. If you really really really mangled your project, then you may be forced to blow out your DerivedData folder, as russes suggested. Also, check the 'Organizer', since Xcode has a way of saving crap all over the place.

    9. Oh, and you checked to make sure that 'armv6' is there right? :)

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