Questions tagged [pch]

Precompile Prefix Header

In iOS development with Xcode, PCH stands for Precompile Prefix Header, to make compiling faster and avoid repeating using same header file over and over again.

146 questions
192
votes
14 answers

How to fix .pch file missing on build?

When I build my c++ solution in Visual Studio it complains that the xxxxx.pch file is missing. Is there a setting I am missing to get the pre-compiled headers back? here is the exact error for completeness: Error 1 fatal error C1083: Cannot open…
Sam Mackrill
  • 4,004
  • 8
  • 35
  • 55
182
votes
6 answers

PCH File in Xcode 6

In my previous projects, I can find the .pch file under Supporting Files. But now in Xcode 6, I couldn't find any .pch file. Any steps should I do to produce this file?
Lie-An
  • 2,563
  • 3
  • 17
  • 20
92
votes
4 answers

iOS Prefix.pch best practices

I have seen many developers that add various convenience macros to the Prefix.pch of their iOS projects. What do (or don't) you recommend adding to the iOS Prefix.pch file? What does your Prefix.pch look like?
hpique
  • 119,096
  • 131
  • 338
  • 476
54
votes
21 answers

Fixing file 'project.pch' has been modified since the precompiled header was built error in Xcode

I was recently working on my application messing around in the info.plist section, and since that my application will not run on my test device: file 'project.pch' has been modified since the precompiled header was built Something to note is that…
user1542348
  • 583
  • 1
  • 4
  • 6
42
votes
6 answers

Sharing precompiled headers between projects in Visual Studio

I have a solution with many Visual C++ projects, all using PCH, but some have particular compiler switches turned on for project-specific needs. Most of these projects share the same set of headers in their respective stdafx.h (STL, boost, etc). I'm…
Assaf Lavie
  • 73,079
  • 34
  • 148
  • 203
41
votes
6 answers

Xcode Preprocessor Output

I want to check the output of the preprocessor for some files. How can I view the preprocessor's output in Xcode?
MacMark
  • 6,239
  • 2
  • 36
  • 41
36
votes
5 answers

Implicit declaration of function - C99

I am currently using Xcode 4, and in my .pch file I have this macro: #define localize(s) NSLocalizedString((s), nil). When I try to use this macro in some .m file, I receive this warning: Implicit declaration of function 'localize' is invalid in…
Misa
  • 889
  • 1
  • 10
  • 20
24
votes
6 answers

How do I fix unexpected end of file error with pch.h

So I have been trying to learn cpp and I was writing a program, and when I try to build the solution, it gives an error saying unexpected end of file while looking for precompiled header. Did you forget to add #include "pch.h" to your…
Druidswarm
  • 241
  • 1
  • 2
  • 3
19
votes
2 answers

XCode 4 Archiving Error: one or more PCH files were found, but they were invalid

Documenting an odd XCode 4 Error here for future reference: "one or more PCH files were found, but they were invalid" Cleaning does not fix the issue, you need to clean the Build Folder by holding down ALT and selecting Product from the menu. The…
The Rat
  • 955
  • 7
  • 10
15
votes
6 answers

PCH was compiled with module cache path error

I changed the name of my username and home folder for my Mac and now when I try building a new project I get an error during the compiling process. How would I correct this? I already cleaned the build folder :0: error: PCH was compiled with module…
Hannibal
  • 151
  • 1
  • 4
11
votes
2 answers

users own pch (clip) in r

Possible Duplicate: How to use an image as a point in ggplot? Is it possible to have user defined pch (clip art or icon or other type of file) used as point in R base or ggplot or other graphical device. For example: set.seed(123) mydt <-…
jon
  • 11,186
  • 19
  • 80
  • 132
10
votes
1 answer

Why doesn't g++ find the precompiled-header that's in the -I include-path?

I'm trying to build a precompiled header and an executable, like so: g++ -g -Wall -std=c++17 \ -c ./src/pch.hpp -o ./build/pch.hpp.gch g++ -g -Wall -std=c++17 \ -c ./src/*.cpp \ -I./build/ -include pch.hpp The pch.hpp.gch file…
nihohit
  • 498
  • 3
  • 23
8
votes
2 answers

_int64 does not name a type

In my pch file I have the following definitions: #if (_MSC_VER < 1300) typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef unsigned char uint8_t; typedef unsigned short…
Nitish
  • 13,845
  • 28
  • 135
  • 263
8
votes
2 answers

How to generate .pch for lots of headers?

My code uses libcxx, sdl and some other libs all the time. How can I generate .pch taking into account every header can include some other headers (even with complex conditions like #ifdef #include #endif. That's why it's difficult to understand…
4ntoine
  • 19,816
  • 21
  • 96
  • 220
8
votes
3 answers

How to deal with precompiled headers randomly becoming corrupted on a cancelled build?

I use Visual C++ 2012 with a project that makes a heavy use of precompiled headers. So heavy that the infamous /Zm switch is in use. When I cancel a build in progress, I sometimes get this error on the next build: error C1852: 'foo.pch' is not a…
Laurent Couvidou
  • 32,354
  • 3
  • 30
  • 46
1
2 3
9 10