Xcode 6 cannot find the .pch file even though it exists

I am getting an error clang: error: no such file or directory: '/path/to/my/project/MyProject/Supporting\ Files/MyProject-Prefix.pch'

from Xcode 6.3.1 when trying to build my application.

However, this file clearly exists, since when I print (or even copy and paste the path from the error message) $ cat /path/to/my/project/MyProject/Supporting\ Files/MyProject-Prefix.pch

to the terminal, the contents of the file are printed to Stdout. The file is also linked to my Xcode and displayed in the document outline.

Does anyone know why Xcode is not finding this file, which obviously exists?

+3


source to share


2 answers


I am assuming that in your project build settings you have "Supporting \ Files" with a backslash running through a space in the "Title prefix" value. The backslash should be removed.

I tried this on a test project with and without backslash, and when editing the filename in Xcode UI, compilation worked without backslash. When the compilation worked, the pbxproj file had this value:

GCC_PREFIX_HEADER = "foobar / Supporting Files / test.pch";



and "Title prefix" in Xcode build settings showed:

foobar / Supporting files /test.pch

The backslash is required when entering a path in the terminal to avoid the space.

+1


source


You have to set short path for title prefix in project settings as shown below:

"MyProject/Supporting Files/MyProject-Prefix.pch"

      



It also rarely happens that there is a folder with a name in the project folder Supporting Files

, and this file must be rights under root

+1


source







All Articles