Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 Cannot Find .pch File, Although it Exists

Tags:

xcode

ios

I am getting the error clang: error: no such file or directory: '/path/to/my/project/MyProject/Supporting\ Files/MyProject-Prefix.pch' from Xcode 6.3.1 when I try to build my application.

However, this file clearly exists, since when I type (or even copy & paste the path from the error message) $ cat /path/to/my/project/MyProject/Supporting\ Files/MyProject-Prefix.pch into the terminal the contents of the file are printed to Stdout. The file is also linked to my Xcode, and is visible in the document outline.

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

like image 966
rfj001 Avatar asked Feb 16 '26 09:02

rfj001


1 Answers

My guess would be in the project build settings you have "Supporting\ Files" with the backslash escaping the space in the value for "Prefix Header". The backslash should be removed.

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

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

and the "Prefix Header" on the Xcode Build Settings showed:

foobar/Supporting Files/test.pch

The backslash is needed when typing the path in terminal to escape the space.

like image 173
Brian Walker Avatar answered Feb 17 '26 21:02

Brian Walker