Xcode linker error: file too small for architecture x86_64

后端 未结 10 1363
深忆病人
深忆病人 2020-12-01 04:21

I\'m developing an application in Xcode.

When I try to build, this error comes up:

ld: in /Users/theodore/Library/Developer/Xcode/DerivedData/Tower-b         


        
相关标签:
10条回答
  • 2020-12-01 04:28

    A clean rebuild didn´t in my case so i explain how i solved the problem:
    - Removed reference to the file (don´t delete the file)
    - Add the file to the project again and run

    0 讨论(0)
  • 2020-12-01 04:31

    Quick way to fix error without complete cache clean:

    1. Open file described in error (in case of this question TWRAppDelegate)
    2. cmd + A
    3. cmd + X
    4. Rebuild - fail
    5. cmd + V
    6. Rebuild - succeed
    0 讨论(0)
  • 2020-12-01 04:32

    Stealing @martin-baulig's answer:

    Try a full rebuild / clean. It's possible that the previous build has been abnormally aborted, leaving the TWRAppDelegate.o file corrupted or zero-size.

    0 讨论(0)
  • 2020-12-01 04:34

    I usually add a space (could be any character for that matter) to the file in question, remove it and then save. Easier and quicker than a clean build.

    0 讨论(0)
  • 2020-12-01 04:37

    rm -rf /Users/hostname/Library/Developer/Xcode/DerivedData

    0 讨论(0)
  • 2020-12-01 04:38

    Since building a clean project may take way too long there is shorter way for those that have the access to the file that is corrupt in the cache:

    • Delete the file (Remove reference)
    • Build project
    • Reinsert file
    • Build project

    Full version so you have no trouble finding the file:

    • Find the file in Xcode project navigator
    • Right click the file and press "show in finder" (opens a finder at the location where the file is)
    • Select the file in Xcode and press backspace then click "Remove reference"
    • Build project (it will fail but wait for it to finish)
    • Reinsert file by dragging it from the finder into the same location you just deleted it
    • Build project (should work now)
    0 讨论(0)
提交回复
热议问题