** Note – these PDFs from more experienced people usually seem to refer to pre-iphone OS 2.0 toolchains – for example LayerKit no longer exists in current apple sdk but you can see its mentioned in the docs. Just be aware of this & that you may need to recode examples to get them to work once you deploy to iphone **
Alright this is where I turn it over to the master. Just read this document and … well the rest is very self explanatory! I just followed it and I’ll put down what i did just in case it helps too but…first… read :
os-eclipse-iphone-cdt-pdf
Steps I followed:
1) installed cygwin locally on vista using all the options especially compilers , sudo,etc.. (read PDF for details)
2) Downloaded iphone toolchain from PDF authors website http://www.pjtrix.com/iphone/articles/eclipse-cdt/iphone-2.0-toolchain.tgz
3) Downloaded apple IPSW http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-4956.20080710.V50OI/iPhone1,1_2.0_5A347_Restore.ipsw
4) copy iphone toolchain stuff into your cygwin directory per PDF
5) unzip IPSW, pull out a certain DMG image file out of it (see PDF)
6) decrypt the DMG image file using something from the iphone toolchain (see PDF)
7) use Transmac or UltraISO to load the DMG
copy certain files from the loaded cd image to the iphone toolchain cygwin directory (see PDF)
9) the fun part… start compiling in cygwin using the make-toolchain file thats provided (this will replicate our iphone compilers locally i guess?)
10) I had a few hiccups. Notably, with the last gcc part of the makefile.
I had to locate the [configure] section and update the path to gxx-include to the following in the makefile:
–with-gxx-include-dir=/usr/local/arm-apple-darwin/include/c++/4.0.0
11) finally, i recompiled HelloWorld, except this time using the apple compilers locally (im pasting what is in the PDF to show the updated compilers makefile for HelloWorld points to):
CC=/usr/local/bin/arm-apple-darwin9-gcc
CXX=/usr/local/bin/arm-apple-darwin9-g++
Then, I Win SCP’d the HelloWorld binary into the /var/root/ directory on the iphone, chmod’ed to give it permissions, and applied LDID to give the binary a bogus signature.
Then, I ran the code and got the same output as before…
Hello, world!
…except this time I had done coding and compiling locally on a vista machine 
_________________
Theres another “setup” doc many pages refer to (Lucas Newman) that I had a hard time finding on the web (dead link on his site or smething like that). Anyways, I found it today, im mirroring it here just in case its useful for anyone:
lucasnewman_nativeapp
———————————— IF YOU HAVE LINKER ISSUES ————————–
Try following post from Michael, seemed to work for him:
The problem with the linker is that the new linker is built OK (in the cctools-iphone build) but it’s never copied to /usr/local/bin. This is because of the silly $SUDO variable that already caused a bunch of problems. It’s not OK to make $SUDO just echo the command in cygwin, the sudo’d commands still have to run, they just don’t require sudo on cygwin! After the cctools-iphone build the next sudo’d command is “make install”. That’s a pretty important step, which includes installing the newly built linker etc to /usr/local/bin.
So, instead of having:
export SUDO=’echo “”;’
change that to:
export SUDO=””
That will ensure all the sudo’d commands still run, even though they don’t require sudo on cygwin.
That’s huge step! But there’s one more hurdle if you’re using cygwin on Windows: you’ll probably get the following error:
/usr/local/bin/arm-apple-darwin9-ld: /usr/local/iphone-sysroot/usr/lib/libc.dylib truncated or malformed object (mach header extends past the end of the file)
collect2: ld returned 1 exit status
This happens because when you extract the files you need from the iPhone firmware DMG, the symbolic links are not preserved (at least they aren’t if you use Transmac). This means that libc.dylib, which should be pointing to libSystem.dylib, which in turn should be pointing to libSystem.B.dylib, is just a text file with the name of the linked file. The solution is to re-create the symlinks in your /home//iphone-2.0-toolchain/iphone-fs/usr/lib directory. I found a handy little script which automates this:
find -size -200c -type f | gawk ‘{p = “”; s = split($0, sp, “/”); for (i = 1; i < s; i++) p = p (p?”/”:””) sp[i]; b = sp[s]; getline a < $0; if (match(a, /^[a-zA-Z0-9_\-\.]*$/)) if(system(”if [ -e " p "/" a " ]; then exit 66; fi”)==66) system(”cd ” p “; rm ” b “; ln -s ” a ” ” b)}’
Run this in the /home//iphone-2.0-toolchain/iphone-fs/usr/lib directory and it should fix all the important symlinks. It doesn’t fix them all and I couldn’t be bothered to debug the command but it fixes the important ones.