You're browsing: magichand Interaction -魔法交互 » 3D, AR » 高光镜面反射 贴图 specular highlights Texture

使用开源工具在Windows & Linux with 开发Iphone程序

Posted in Game engine, iphone on Feb 09 by admin | PrintText Resizer Text Resizer
使用开源工具在Windows & Linux with 开发Iphone程序

只有Windows 和Linux的朋友相开发Iphone程序,简直难上加难,怎么解决呢。Hack门帮我们想到了招术。他们将Iphone的依赖工具链,移植到Windows和Linux上了。这样你们就可以通过Windows和linux开发了!

from:http://www.pjtrix.com/blawg/2009/07/21/iphone-development-on-windows-linux-with-open-source-tools/

by dreadpiratepj on Jul.21, 2009, under iphone, linux, open.source, windows

Yesterday I presented at OSCON 2009. I spoke about how to use Eclipse and the iPhone-dev team’s GCC cross-compiler to develop for iPhone on Windows & Linux. I also spoke about XMLVM, an open source project that lets you develop in Java for Android and deploy on iPhone or Palm WebOS.

You can download the slides and program examples here.

To get started with open source iPhone development, you can download the open source toolchain for Linux or for Windows/Cygwin.

Note: To use the toolchain, you need to obtain the iPhone OS headers, frameworks and libraries. You can jailbreak your device and extract the frameworks and libraries using SSH, or you can decrypt the firmware and extract the framework and libraries from the decrypted disk image. The binaries you need are /System/Library/Frameworks and /usr/lib .

You can download the headers from the iPhone-dev team’s Subversion repository with svn co http://iphone-dev.googlecode.com/svn/branches/include-1.2-sdk

To use the iPhone-dev team’s headers, you need headers for Mac OS X 10.4 SDK. Then you type this at the command line:

cd /path/to/iphone-dev/svn/branches/include-1.2-sdk
./configure --with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk

sudo bash install-headers.sh

Or you can extract them from the official iPhone SDK. :-)

Once you get the binaries and headers, move them to /usr/local/iphone-sysroot/ . The headers go in /usr/local/iphone-sysroot/usr/include/ , frameworks go in /usr/local/iphone-sysroot/System/Library/Frameworks/ , and libraries in /usr/local/iphone-sysroot/usr/lib/ .

Then to compile and link, set CFLAGS and LDFLAGS like below :

export CFLAGS=-I/usr/local/lib/gcc/arm-apple-darwin9/4.2.1/include \
-isysroot /usr/local/iphone-sysroot

export LDFLAGS=-framework CoreFoundation -framework Foundation \
-framework UIKit -lobjc -bind_at_load -isysroot /usr/local/iphone-sysroot

Then use these compile and linker commands :

/usr/local/bin/arm-apple-darwin9-gcc -c $(CFLAGS) main.c HelloWorld.m

/usr/local/bin/arm-apple-darwin9-gcc $(LDFLAGS) HelloWorld.o main.o \
-o HelloWorld

The easiest way to set this up for each project is in a makefile. Look in the HelloWorld example in the zip file with the slides for an example.

de.licio.usdiggemailfacebookfriendfeedgoogle bookmarkslinkedinmixxmyspacenetvibesnewsvineposterousredditrssstumbleupontechnoratitumblrtwitteryahoobuzzyahoomywebadd to favoritesmisterwongprint friendlyPDF

About admin

Leave a Reply