Hi
I am trying to compile an simple below hello world c program under iPhone.
#include <stdio.h>
int main (void)
{
printf ("Hello, world!\n");
return 0;
}
using gcc version & details
gcc -v
Using built-in specs.
Target: arm-apple-darwin9
Configured with: ../llvm-gcc-4.2/configure --build=x86_64-unknown-linux-gnu --host=arm-apple-darwin9 --enable-static=no --enable-shared=yes --prefix=/usr --localstatedir=/var/cache/iphone-gcc --enable-languages=c,c++,objc,obj-c++ --enable-wchar_t=no --with-gxx-include-dir=/usr/include/c++/4.0.0
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5555)
when i try compile & link with below command guess it gets compiled but at link time it give error
ld: library not found for -lSystem
# gcc -v try1.c -o try1
Using built-in specs.
Target: arm-apple-darwin9
Configured with: ../llvm-gcc-4.2/configure --build=x86_64-unknown-linux-gnu --host=arm-apple-darwin9 --enable-static=no --enable-shared=yes --prefix=/usr --localstatedir=/var/cache/iphone-gcc --enable-languages=c,c++,objc,obj-c++ --enable-wchar_t=no --with-gxx-include-dir=/usr/include/c++/4.0.0
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5555)
/usr/libexec/gcc/arm-apple-darwin9/4.2.1/cc1 -quiet -v -D__DYNAMIC__ try1.c -fPIC -fno-builtin-strcat -fno-builtin-strcpy -quiet -dumpbase try1.c -maspen-version-min=2.0 -auxbase try1 -version -o /var/tmp//ccBLU3Bu.s
ignoring nonexistent directory "/usr/lib/gcc/arm-apple-darwin9/4.2.1/../../../../arm-apple-darwin9/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/arm-apple-darwin9/4.2.1/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
GNU C version 4.2.1 (Based on Apple Inc. build 5555) (arm-apple-darwin9)
compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5555).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64634
Compiler executable checksum: 7f3b3f9f41787e32b9fcd64c73e06ffd
as -arch arm -force_cpusubtype_ALL -o /var/tmp//ccvTIs4w.o /var/tmp//ccBLU3Bu.s
/usr/libexec/gcc/arm-apple-darwin9/4.2.1/collect2 -dynamic -arch arm -force_cpusubtype_ALL -aspen_version_min 2.0 -weak_reference_mismatches non-weak -o try1 -lcrt1.10.5.o -L/usr/lib/gcc/arm-apple-darwin9/4.2.1 -L/usr/lib/gcc/arm-apple-darwin9/4.2.1 -L/usr/lib/gcc/arm-apple-darwin9/4.2.1/../../.. /var/tmp//ccvTIs4w.o -lgcc_s.10.5 -lgcc -lSystem
ld: library not found for -lSystem **<----------error**
collect2: ld returned 1 exit status **<----------exit status**
How do is solve this ?
Please let me know if you have any solution.
Thanks & Regards,
Nickin