iPhone.sdk

Previous topic - Next topic

marovada

I've figured this out in case anyone else wants to know.

ios 6 was introduced with the iPhone 5.  The original iphones had an armv6 processor and iPhone 4 had an armv7 processor.  iPhone 5 has an armv7s processor.  Since the introduction of the iPhone 5, the default is for xcode to build the binary for both armv7 and armv7s.  You can see this in the build settings under 'Valid architectures'.

I was building libPROGRAM.a either for armv7 or armv7s with the -arch switch.  But it has to be built for both (unless you change the 'Valid architectures' to either one or the other.  You wouldn't want to build it only for armv7s). You can build for both architectures by using the -arch switch twice when building libPROGRAM.a ie -arch armv7 -arch armv7s

It's explained pretty well in this article that I was lucky enough to find:http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/

This wasn't an issue building libPROGRAM.a with gcc from the iPhone 5 sdk.

Kitty Hello

You gorgot an C++ file to include. gpc_tempg.cpp maybe?
They are definitely in one of these files.

marovada

Quote from: Kitty Hello on 2013-Jul-10
You gorgot an C++ file to include. gpc_tempg.cpp maybe?
They are definitely in one of these files.

I included all of the cpp files.

hardyx

Quote from: marovada on 2013-Jul-10
It's explained pretty well in this article that I was lucky enough to find:http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/

This wasn't an issue building libPROGRAM.a with gcc from the iPhone 5 sdk.
Then, iOS SDK 6.x needs the library to have armv7 and armv7s architectures. If not, XCode doesn't find the functions defined in the library. We have a problem...

marovada

#19
It shouldn't be a problem if you use the GLBasic editor in windows because Gernot has his own program to create the libPROGRAM.a

Edit: Also, you can change the build settings in Xcode to only compile for armv7 bceause armv7s is backward compaitable with armv7.  Anyway, GLBasic editor in windows works fine.  I'm compiling from the command line on a Mac and I've found a solution, so no problem.