I'm getting “clang: error: no input files”

后端 未结 10 1290
失恋的感觉
失恋的感觉 2020-12-15 15:51

I had a file which I deleted and replaced with another file, somewhere else, of the same name.

Despite cleaning, and trying this multiple times, I keep getting this

相关标签:
10条回答
  • 2020-12-15 16:15

    In case everything fails (i.e. first try bames53 suggestion)

    Ok, this might be dangerous so make a copy of your whole project first:

    • close Xcode
    • locate the project file in the Finder
    • right click, choose "show package contents"
    • open project.pbxproj in a text editor of your choice, but not Xcode
    • search for your file
      • at the beginning of the line that shows up, you'll see some id like 640450991409CF5C00B3B580. Search for this and delete any line you find.
      • pay attention, not to break the syntax (balance parenthesis and brackets, pay attention for commas)
    • when you are done, save the file and try to open the project in Xcode. Add the missing file via the Add file… dialog of Xcode. It is still in the folder of your project — if you added it successfully in the first place — you just got rid of all project references.
    • dont be surprised, if it doesnt work instantly — you have a copy. copy it again, new try.

    And remember: make a copy of your whole project first — for every try. or copying the project.pbxproj might be enough.

    0 讨论(0)
  • 2020-12-15 16:16

    I had this error in monodevelop. I just went to edit>preferences and changed the default location of the program files. It was set to the monodevelop default they give you when you open a file and not the folder i changed it too. Likely, you need to adjust the settings of xcode, where you stored your files.

    0 讨论(0)
  • 2020-12-15 16:20

    I was seeing this while setting up a React Native project. Solved it using:

    sudo xcode-select --switch /Applications/Xcode.app
    

    Source

    0 讨论(0)
  • 2020-12-15 16:24

    The problem might be because your project > target > Build Phases > Compile Sources is trying to compile a file that doesn't exist. It might be in there twice, like the below screen shot. My project contains UIImage+FFXtras, I can even remove it and re-add it and this won't resolve the problem!

    missing source file

    I'm not sure how the project gets into this state - but I know it's not obvious what is going wrong. Highlight the red problem one and remove it.

    So have a look in compile sources phase for the file clang is complaining about.

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