为äºä»£ç ä¿å¯æè
代ç éç¨ççåå éè¦æç°æç代ç æå
æ¾å
¥éæåºä¸ï¼è¿ä¹æ¯éæåºç好å¤ï¼æ以ä»å¤©ä¸å¤©é½å¨ç 究å¦ä½ç¨xcode 4å建éæåºï¼ä¹æ¯ä¸ºäºæ们ç项ç®éè¦ãQQåå¸çå¾®åSDKä¼æ¥éï¼ä¹æ¯å 为没ææéæåºæå
为unniver static librariesçåå ï¼è³äºæ¯ä»ä¹æ¯unniver static librariesï¼å¤§å®¶å¯ä»¥googleä¸ä¸ãï¼
http://blog.boreal-kiss.net/2011/03/15/how-to-create-universal-static-libraries-on-xcode-4/ï¼
ä¸é¢æ¯å建éæåºçæ¹æ³
1.xcode-create project-cocoa touch static libary.è¿æ ·å°±é¡ºå©çå建äºä¸ä¸ªéæåºæ¨¡æ¿ãéé¢åªæä¸ä¸ªæ件ï¼æ²¡æä»ä¹ç¨å¤ã
2.å¨éæåºä¸å建ä¸ä¸ªç±»ï¼å½å为MyClassãè¿æ ·æ们就å¾å°äº.h å .m æ件ã
3.åå
¥æ¹æ³
///////////////////////.h
#import <Foundation/Foundation.h>
@interface MyClass : NSObject {
}
- (int)add:(int)a b:(int)b;
@end
/////////////////////////////////.m
#import "MyClass.h"
@implementation MyClass
- (int)add:(int)a b:(int)b
{
return (a + b);
}
@end
æ¹æ³å¾ç®åï¼å¦æä½ è¿æ¯çä¸æï¼å°±ä¸è¦åä¸é¢çäºã
4.ç¶å Edit Scheme pane (Product > Edit Scheme), change its build configuration to Release,è¿æ ·å°±äº§çä¸ä¸ªrelease模å¼çéæåºï¼æ³¨æreleaseådebug模å¼çéæåºæ¯æåºå«ï¼å¦æå¨å¼ç¨å¹¶æè¿ä¸ªæ¨¡å¼è°éï¼å°±ä¼æ¥åºâignoring file /Users/laiqiangzhuo/Desktop/TestLibary/TestLibary/libLibary.a, missing required architecture i386 in fileâçé误ã
5ãç¶åå¨ä¸»ç®å½ä¸æ¾å°/build/Release-iphoneos/libLibary.aæ件ï¼å¹¶æå®æå°è¦ä½¿ç¨å®çprojectä¸ã
6ãå¨projectä¸å¼ç¨MyClass.hæ件ã