There seems to be lots of posts regarding that error message but I couldn’t find one that has something to do with actual code. I have an Xcode 4.0 project called prog1, and inside it is a single file main.m:
#import <Foundation/Foundation.h>
@interface Fraction : NSObject
-(void) print;
-(void) setNumerator: (int) n;
-(void) setDenominator: (int) d;
@end
@implementation Fraction {
int numerator;
int denominator;
}
-(void) print {
NSLog(@"The fraction is %i/%i.", numerator, denominator);
}
-(void) setNumerator: (int) n {
numerator = n;
}
-(void) setDenominator: (int) d {
denominator = d;
}
@end
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Fraction *f = [[Fraction alloc] init];
[f setNumerator:5];
[f setDenominator:6];
[f print];
[pool drain];
return 0;
}
This is the complete error message:
ProcessPCH /Users/rh/Library/Developer/Xcode/DerivedData/prog1-djucagjboveiuwcnycgafzuugucf/Build/PrecompiledHeaders/prog1-Prefix-ethcjsncaxczlsgsnayacjarhmne/prog1-Prefix.pch.pth prog1/prog1-Prefix.pch normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/rh/Desktop/prog1/prog1
setenv LANG en_US.US-ASCII
/Developer/usr/bin/clang -x objective-c-header -arch x86_64 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wshorten-64-to-32 -DDEBUG -isysroot /Developer/SDKs/MacOSX10.6.sdk -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -iquote /Users/rh/Library/Developer/Xcode/DerivedData/prog1-djucagjboveiuwcnycgafzuugucf/Build/Intermediates/prog1.build/Debug/prog1.build/prog1-generated-files.hmap -I/Users/rh/Library/Developer/Xcode/DerivedData/prog1-djucagjboveiuwcnycgafzuugucf/Build/Intermediates/prog1.build/Debug/prog1.build/prog1-own-target-headers.hmap -I/Users/rh/Library/Developer/Xcode/DerivedData/prog1-djucagjboveiuwcnycgafzuugucf/Build/Intermediates/prog1.build/Debug/prog1.build/prog1-all-target-headers.hmap -iquote /Users/rh/Library/Developer/Xcode/DerivedData/prog1-djucagjboveiuwcnycgafzuugucf/Build/Intermediates/prog1.build/Debug/prog1.build/prog1-project-headers.hmap -I/Users/rh/Library/Developer/Xcode/DerivedData/prog1-djucagjboveiuwcnycgafzuugucf/Build/Products/Debug/include -I/Users/rh/Library/Developer/Xcode/DerivedData/prog1-djucagjboveiuwcnycgafzuugucf/Build/Intermediates/prog1.build/Debug/prog1.build/DerivedSources/x86_64 -I/Users/rh/Library/Developer/Xcode/DerivedData/prog1-djucagjboveiuwcnycgafzuugucf/Build/Intermediates/prog1.build/Debug/prog1.build/DerivedSources -F/Users/rh/Library/Developer/Xcode/DerivedData/prog1-djucagjboveiuwcnycgafzuugucf/Build/Products/Debug -c /Users/rh/Desktop/prog1/prog1/prog1/prog1-Prefix.pch -o /Users/rh/Library/Developer/Xcode/DerivedData/prog1-djucagjboveiuwcnycgafzuugucf/Build/PrecompiledHeaders/prog1-Prefix-ethcjsncaxczlsgsnayacjarhmne/prog1-Prefix.pch.pth
clang: error: no such file or directory: '/Users/rh/Desktop/prog1/prog1/prog1/prog1-Prefix.pch'
clang: error: no input files
Command /Developer/usr/bin/clang failed with exit code 1
I don’t see anything wrong here, but then again I just started learning Objective-C. Help?
Just to close this question, I will quote Till’s comment which he’s too lazy to write as an answer. 🙂
“That file is called the precompiled header. You may fix the problem by deactivating the use of precompiled headers within Xcode’s build-settings.”