Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pityme

macrumors newbie
Original poster
Aug 4, 2008
13
0
Does anyone know how to compile a dylib on Mac leopard and use it in iphone apps?

Or any hint on how to compile a C program in Mac OSX, and execute it in iphone 2.0 terminal?
 

pityme

macrumors newbie
Original poster
Aug 4, 2008
13
0
Here is the situation:
I want to write some C program and run it on iPhone.

iPhone has different CPU than the Mac so I have to use a different compiler to compile the codes. I am not sure but I think xcode uses arm-apple-darwin9-gcc instead of a normal gcc for Mac to compile code so the resulting executable could be run on iPhone.

So anyone could tell me if I want to compile a C program by going through :
./configure > make procedure how could I do it?
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
You do realise that Apple forbids the use of third party libraries on the iPhone don't you? If you do use a solution I doubt you'll be able to release the app on the App Store.
 

pityme

macrumors newbie
Original poster
Aug 4, 2008
13
0
Thanks for the reply.I have heard about that.
That's why I have to make libaray myself.
 

pityme

macrumors newbie
Original poster
Aug 4, 2008
13
0
So for the official apple store apps, instead of using dylib and frameworks, I have to compile everything in xcode? oh~~~it's a lot of work then.....

But for the hacked iphone and unofficial apps, ppl still can use libraries right?:D

Do you know how to cross compile iphone program on mac?
here is the command i use to configure the make.
./configure --cross-prefix=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ --enable-cross-compile --cc=arm-apple-darwin9-gcc-4.0.1 --arch=armv

It always shows me "C compiler test failed."
I think it is because the code is not compatiable to the compiler right?Anyone could give some hints?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.