Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it OK to remove Prefix.pch file from the Xcode project?

The Xcode project generates Prefix.pch file automatically. When I deleted this file and tried to build, I got build error saying '*_Prefix.pch' file is missing.

  • Is Prefix.pch file is a must for compiling with Xcode?
  • How can I build without the Prefix.pch file?
like image 984
prosseek Avatar asked Jan 18 '11 19:01

prosseek


People also ask

What is PCH file in iOS?

pch is a precompiled header. Precompiled headers were invented to make compiling faster. Rather than parsing the same header files over and over, these files get parsed once, ahead of time.

What is PCH file?

In computer programming, a precompiled header (PCH) is a (C or C++) header file that is compiled into an intermediate form that is faster to process for the compiler.

How do I create a PCH file in Xcode?

From your Xcode menu, select File > New > File... From iOS template options, select Other > PCH file. Name the file <target_name>-Prefix. pch, and then select Create.


1 Answers

In Xcode, go to your target's build settings (Command-Option-E, build tab) and uncheck Precompile Prefix Header (GCC_PRECOMPILE_PREFIX_HEADER). You can also remove the value of the Prefix Header setting if you wish.

Prefix headers are compiled and stored in a cache, and then automatically included in every file during compilation. This can speed up compilation, and lets you include a file without adding an import statement to every file using it. They are not required, and actually slow compilation whenever you change them.

like image 173
ughoavgfhw Avatar answered Oct 07 '22 00:10

ughoavgfhw