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

后端 未结 10 1289
失恋的感觉
失恋的感觉 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:02

    Comment Quoted from another site was the issue is resolved for me

    hmm that's strange. Try this - click on the name of your project on the list of files/folders on the left in Xcode (at the very top of the list). Look at the "Targets" section on the left-hand side of the window to the right. Likely, there's two listed with the second being a "test" item. Right-click on that item and select "delete". Then try to run the project again. See screenshot below for a visual cue.

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

    I use quite a few cocoa pods and have just had this happen to me. A quick "pods update" sorted things out for me. -phil

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

    If you are using vs code and facing this issue which says

    clang: error: no such file or directory: 'filename'
    clang: error: no input files
    

    Error while running files:

    error while running files

    I solved this issue by removing the space or replacing the space with underscore(_) in the filename .extension

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

    Got the similar troubles.

    It seems XCode does not generate correct relative filepath when your project refer to an already existing source tree (relative path does not contain the .xcodeproj in the path of the file to be compiled).

    There is a simple fix however: in the project explorer select the file or files files then look at the options in the file inspector. One of them is labeled "Location"; set it to absolut path and try again. This fixed the issue for me :)

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

    Additional to all answers:

    1. delete derived data
    2. reboot
    3. delete derived data
    4. clean
    5. build
    6. Success!

    Only this sequence works for me in my case.

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

    Add this line in your pod-file and run pod install:

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