I am using:
clang -ObjC -framework UIKit -o /var/compiled/c /Documents/Source/main.m
In OS X terminal. I also tried UIKit.framework, but I am getting
Fatal Error: 'UIKit/UIKit.h' not found
with both.
Any suggestions?
Thanks
Clang uses the LLVM compiler as its back end and it has been included in the release of the LLVM since the LLVM 2.6. Clang is also built to be a drop-in replacement for GCC command. In its design, the Clang compiler has been constructed to work very similarly to GCC to ensure that portability is maximized.
While LLVM and GCC both support a wide variety languages and libraries, they are licensed and developed differently. LLVM libraries are licensed more liberally and GCC has more restrictions for its reuse. When it comes to performance differences, GCC has been considered superior in the past.
LLVM is a backend compiler meant to build compilers on top of it. It deals with optimizations and production of code adapted to the target architecture. CLang is a front end which parses C, C++ and Objective C code and translates it into a representation suitable for LLVM.
Clang is much faster and uses far less memory than GCC. Clang aims to provide extremely clear and concise diagnostics (error and warning messages), and includes support for expressive diagnostics. GCC's warnings are sometimes acceptable, but are often confusing and it does not support expressive diagnostics.
This has been already answered in the Apple developer forum, you can find the whole discussion in here. In the answer marked as the solution to the question they say:
1 - check your PATH variable first:
$ echo $PATH
2 - assuming /System/Library/Frameworks is not included in PATH, add it:
$ PATH=$PATH:/System/Library/Frameworks
3 -now we're ready for Mr. Kochun's incantation:
$ clang -fobjc-arc -framework Foundation main.m prog1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With