macOS: 10.14.5
XCode: 10.2.1
Clang: 8.0.0
I am able to successfully compile Obj-C with XCode but am getting a fatal error that Foundation.h
is missing when attempting to compile from the command line. Any ideas on how to fix this?
$ cat first_program.m
#import <Foundation/Foundation.h>
int main(int argc, const char *argv[]) {
@autoreleasepool {
NSLog(@"Hello, World!");
}
return 0;
}
$ clang -Wall -framework Foundation first_program.m
first_program.m:1:9: fatal error: 'Foundation/Foundation.h' file not found
#import <Foundation/Foundation.h>
^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
$ clang -v
clang version 8.0.0 (tags/RELEASE_800/final)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin