PDA

View Full Version : Removing the template generated .pch file?




DUMBDOG
Aug 22, 2009, 10:27 PM
I was wondering if there is a way to remove the .pch file from an iPhone project and still have it build correctly?

I assumed it wouldnt be that hard, but after searching the net for a couple hours I havent found a solution.

Basically, as you probably know, when creating a new iPhone project, it will automatically generate the pre-compiled header file. I would like to remove that file altogether, but the problem is when I delete the file I get the errors:

Line Location Chilias_Animal_House_Prefix.pch:0: i686-apple-darwin9-gcc-4.2.1: warning: '-x objective-c-header' after last input file has no effect
Line Location Chilias_Animal_House_Prefix.pch:0: i686-apple-darwin9-gcc-4.2.1: no input files
Line Location Chilias_Animal_House_Prefix.pch:0: i686-apple-darwin9-gcc-4.2.1: /Users/iphonedevelopment/Desktop/cwd-Chilias.Animal.House/Chilias_Animal_House_Prefix.pch: No such file or directory
Line Location Chilias_Animal_House_Prefix.pch:0: Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

Where "Chilias_Animal_House" is my project name. So Im thinking that there is some option deep within the project settings that I can modifiy to get it to stop looking for this file, but I cant seem to find it.

Does anyone know how to get around this?

Thanks.



kainjow
Aug 23, 2009, 12:22 AM
The file is referenced in a Build setting for your project's target. I don't know the exact name off hand but if you Get Info your target and go to the Build tab, search for "pre-compiled" (or similar) and it should come up.

Why do you want to remove it?

Troglodyte
Aug 24, 2009, 09:35 AM
Why do you want to remove it? Unless you've got a good reason it's best to leave stuff alone.

DUMBDOG
Aug 24, 2009, 09:38 PM
I want to remove it because I dont like IDE's putting unnecesary garbage into my project's that I dont fully understand.

Basically, until I understand what and why an IDE does something for me, and how I can replicate that functionality without the IDE automatically doing it for me, I prefer to do without it. Thats the main reason why I prefer to simply use gcc and makefiles for compilation and linking. But as far as I know, thats not possible for programming on the iPhone.

Is that a wrong way of going about things?

@kainjow:
do you perhaps know of the specific build setting? Ive tinkered a bit with it, and havent found any success. And I dont really want to change too much without knowing what Im doing.

admanimal
Aug 24, 2009, 09:43 PM
A .pch file is a pre-compiled header that the compiler uses to speed up compilation by avoiding having to re-compile large headers every time they are included in a source file. There is no logical reason to not allow Xcode to do this. It isn't writing any mysterious code and adding it to your program, it's just creating an intermediate file that speeds up compilation.

dejo
Aug 24, 2009, 10:56 PM
I want to remove it because I dont like IDE's putting unnecesary garbage into my project's that I dont fully understand.
It's necessary and it's not garbage. That help? :D

`lowell`
Aug 25, 2009, 12:35 AM
So Im thinking that there is some option deep within the project settings that I can modifiy to get it to stop looking for this file, but I cant seem to find it.

looking for this?

http://imgur.com/oA4Tp.png

double click on the target; it's there. it'll build if you delete that and the file.

.

Is that a wrong way of going about things?

absolutely not; experimentation and exploration are great ways to learn.