24

I am totally new to the Xcode and getting the error below:

clang: error: no such file or directory: '/usersd/chairman/desktop/MySecondTabApp/MySecondTabbApp/"MySecondTabbApp/MySecondTabbApp-Prefix.pch"'

Clang: error: no input files

Command/Users/chairman/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/user/bin/clang failed with exit code 1

Cœur
  • 37,241
  • 25
  • 195
  • 267
Dhanraj
  • 249
  • 1
  • 2
  • 3
  • did you even find a solution to this I'm having the exact same problem (using Xcode 6, whereas the code worked absolutely fine with Xcode 5) – Taskinul Haque Feb 18 '15 at 04:33

9 Answers9

42

Did you move your folder/files after making the project? It's because Xcode can't find the prefix header for some reason. It can be easily fixed by relocating it.

Change the Prefix Header to where the .pch file is located in your folder.

Cœur
  • 37,241
  • 25
  • 195
  • 267
TheAmateurProgrammer
  • 9,252
  • 8
  • 52
  • 71
  • Currently in my project in front of Prefix Header is "MySecondTabbApp/MySecondTabbApp-Prefix.pch" – Dhanraj Oct 25 '12 at 08:05
  • Is your pch file located there? – TheAmateurProgrammer Oct 25 '12 at 08:10
  • Currently in my project in front of Prefix Header is "MySecondTabbApp/MySecondTabbApp-Prefix.pch" MySecondTabbApp is the name of my Project & MySecondTabbApp-Prefix.pch file which is in Supporting Files folder comes under project root. Can u suggest me correct Prefix Header? – Dhanraj Oct 25 '12 at 08:12
  • Ya pch file located there. Automatically set the Prefix Header to "MySecondTabbApp/MySecondTabbApp-Prefix.pch". – Dhanraj Oct 25 '12 at 08:56
  • 2
    Are you absolutely sure that the file is `/users/chairman/desktop/MySecondTabApp/MySecondTabbApp/MySecondTabbApp/MySecondTabbApp-Prefix.pch`? Because I'm fairly certain it's because of Xcode that's unable to locate your .pch file. – TheAmateurProgrammer Oct 25 '12 at 09:01
  • Ya. I have one doubt .pch file is under Supporting files folder which is under project root then why path cannot showing folder name of the same? – Dhanraj Oct 25 '12 at 10:09
  • Also in Build Settings -> 1. Other C Flags 2. Other Linker Flags are blank. Which are the correct inputs over there i'll give? Can you tell me which are the fields from "Build Settings" are mandatory to filled or set up properly to Build successfully? – Dhanraj Oct 25 '12 at 10:23
6

Select your project and go to Build Phases and search go through whole list under "Compile Sources". If some files are red then delete those files by pressing - button at the bottom. Also make sure these files are in the list without red color.

Kashan Qamar
  • 61
  • 1
  • 2
5
  1. Make new file: ⌘cmd+N iOS/Mac > Other > PCH File >
  2. YourProject-Prefix.pch. Project > Build Settings > Search:
  3. "Prefix Header". Under "Apple LLVM 6.0" you will get the Prefix
  4. Header key. Type in: "YourProjectName/YourProject-Prefix.pch"
  5. Clean project: ⌘cmd+⇧shift+K Build project: ⌘cmd+B
Zverusha
  • 317
  • 3
  • 5
1

please go to Prefix header file

Target> Build Settings > Prefix Header. then copy paste this line & change Your Project name

$(SRCROOT)/Your_Project_name-Prefix.pch

Its working you 100% gurantee.

saraman
  • 568
  • 7
  • 19
0

Had the same problem. Try replacing MySecondTabbApp/MySecondTabbApp-Prefix.pch with MySecondTabbApp-Prefix.pch.

Vi Matviichuk
  • 1,122
  • 15
  • 32
0

Had same problem. Had to go into Finder (outside of Xcode) and place my .pch file in a new folder to match the requested path.

Once the file's location matched the path it was fixed.

Will Dennis
  • 1,045
  • 1
  • 10
  • 12
0

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.

enter image description here

0

updating the pods helped me

pod update

It turned out to be a dependency issue. Updating the pod installed necessary components

KawaiKx
  • 9,558
  • 19
  • 72
  • 111
  • Please edit your answer to include some explanation. Code-only answers do very little to educate future SO readers. Your answer is in the moderation queue for being low-quality. – mickmackusa Apr 21 '17 at 17:04
0
clang: error: no such file or directory: '/usersd/chairman/desktop/MySecondTabApp/MySecondTabbApp/"MySecondTabbApp/MySecondTabbApp-Prefix.pch"'

It means your Pch file does not exists in above path. Check in you code where PCH file is available and and take that path and upload in PrefixHeader in Apple LLVM 8.0. Like

$(SRCROOT)/PATH/app_PrefixHeader.pch
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Hari c
  • 1,139
  • 11
  • 11