I use ssh to iphone, and can compile console apps on iphone using clang or gcc. But now how can I link against UIKit? Compiler finds headers and stuck at linking.
what args I should pass to clang? How can I check if I have the required static/shared libs? what exactly are the files to link against?
the example program:
#import <stdio.h>
#import <UIKit/UIView.h>
int main() {
UIView *U = [UIView alloc];
printf("OK\n");
return 0;
}
Here is the command line and error:
$ clang main.m
Undefined symbols:
"_OBJC_CLASS_$_UIView", referenced from:
__objc_classrefs__DATA@0 in main-2RgCk6.o
"_objc_msgSend", referenced from:
_main in main-2RgCk6.o
ld: symbol(s) not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
extra info:
$ uname -a
Darwin devphone-teki-iPhone 13.0.0 Darwin Kernel Version 13.0.0: Sun Dec 16 19:58:44 PST 2012; root:xnu-2107.7.55~11/RELEASE_ARM_S5L8940X iPhone4,1 arm N94AP Darwin
$ clang --version
clang version 3.1 (trunk 152547)
Target: arm-apple-darwin13.0.0
Thread model: posix