Hi, What do these commands report?
file libSFHFKeychainUtils.a nm libSFHFKeychainUtils.a Rolf On Tue, Jan 3, 2012 at 7:52 AM, Xy <[email protected]> wrote: > I have a very simple Obj-C binding lib: > > using System; > using MonoTouch.Foundation; > > > namespace SFHFKeychain > { > [BaseType (typeof (NSObject))] > interface SFHFKeychainUtils > { > //+ (NSString *) getPasswordForUsername: (NSString *) username > andServiceName: (NSString *) serviceName error: (NSError **) error; > [Static, Export > ("getPasswordForUsername:andServiceName:error:")] > string getPassword(string username, string serviceName, out > NSError error); > > //+ (BOOL) storeUsername: (NSString *) username andPassword: > (NSString *) password forServiceName: (NSString *) serviceName > updateExisting: (BOOL) updateExisting error: (NSError **) error; > [Static, Export > ("storeUsername:andPassword:forServiceName:updateExisting:error:")] > bool storeUsernameAndPassword(string username, string > password, string serviceName, bool updateExisting, out NSError error); > > //+ (BOOL) deleteItemForUsername: (NSString *) username > andServiceName: (NSString *) serviceName error: (NSError **) error; > [Static, Export ("deleteItemForUsername:andServiceName:error:")] > bool deleteItem(string username, string serviceName, out > NSError error); > } // SFHFKeychainUtils > } > > Here is my AssemplyInfo.cs: > > using System; > using MonoTouch.ObjCRuntime; > > [assembly: LinkWith ("libSFHFKeychainUtils.a", LinkTarget.Simulator | > LinkTarget.ArmV6 | LinkTarget.ArmV7, ForceLoad = true)] > > And here is the Makefile I use to build the lib: > > BTOUCH=/Developer/MonoTouch/usr/bin/btouch > XBUILD=/Developer/usr/bin/xcodebuild > PROJECT_ROOT=SFHFKeychainUtils > PROJECT=$(PROJECT_ROOT)/SFHFKeychainUtils.xcodeproj > TARGET=SFHFKeychainUtils > > all: SFHFKeychainUtils.dll > > libSFHFKeychainUtils-i386.a: > $(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphonesimulator > -configuration Release clean build > mv -f $(PROJECT_ROOT)/build/Release-iphonesimulator/lib$(TARGET).a $@ > > libSFHFKeychainUtils-armv6.a: > $(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphoneos -arch > armv6 -configuration Release clean build > mv -f $(PROJECT_ROOT)/build/Release-iphoneos/lib$(TARGET).a $@ > > libSFHFKeychainUtils-armv7.a: > $(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphoneos -arch > armv7 -configuration Release clean build > mv -f $(PROJECT_ROOT)/build/Release-iphoneos/lib$(TARGET).a $@ > > libSFHFKeychainUtils.a: libSFHFKeychainUtils-i386.a > libSFHFKeychainUtils-armv6.a libSFHFKeychainUtils-armv7.a > lipo -create -output $@ $^ > > SFHFKeychainUtils.dll: api.cs AssemblyInfo.cs libSFHFKeychainUtils.a > $(BTOUCH) -e api.cs AssemblyInfo.cs --out=$@ > --link-with=libSFHFKeychainUtils.a,libSFHFKeychainUtils.a > > clean: > -rm -f *.a *.dll > > My project compiles fine when config is set to iPhoneSimulator, but when > it's set to iPhone, below error appears in the build output: > > Undefined symbols for architecture armv6: > "_SecItemCopyMatching", referenced from: > +[SFHFKeychainUtils getPasswordForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_SecItemUpdate", referenced from: > +[SFHFKeychainUtils > storeUsername:andPassword:forServiceName:updateExisting:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_SecItemAdd", referenced from: > +[SFHFKeychainUtils > storeUsername:andPassword:forServiceName:updateExisting:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_SecItemDelete", referenced from: > +[SFHFKeychainUtils deleteItemForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_kSecAttrAccount", referenced from: > +[SFHFKeychainUtils getPasswordForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > +[SFHFKeychainUtils > storeUsername:andPassword:forServiceName:updateExisting:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > +[SFHFKeychainUtils deleteItemForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_kSecAttrLabel", referenced from: > +[SFHFKeychainUtils > storeUsername:andPassword:forServiceName:updateExisting:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_kSecAttrService", referenced from: > +[SFHFKeychainUtils getPasswordForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > +[SFHFKeychainUtils > storeUsername:andPassword:forServiceName:updateExisting:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > +[SFHFKeychainUtils deleteItemForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_kSecClass", referenced from: > +[SFHFKeychainUtils getPasswordForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > +[SFHFKeychainUtils > storeUsername:andPassword:forServiceName:updateExisting:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > +[SFHFKeychainUtils deleteItemForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_kSecClassGenericPassword", referenced from: > +[SFHFKeychainUtils getPasswordForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > +[SFHFKeychainUtils > storeUsername:andPassword:forServiceName:updateExisting:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > +[SFHFKeychainUtils deleteItemForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_kSecReturnAttributes", referenced from: > +[SFHFKeychainUtils getPasswordForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > +[SFHFKeychainUtils deleteItemForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_kSecReturnData", referenced from: > +[SFHFKeychainUtils getPasswordForUsername:andServiceName:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > "_kSecValueData", referenced from: > +[SFHFKeychainUtils > storeUsername:andPassword:forServiceName:updateExisting:error:] in > libSFHFKeychainUtils.a(SFHFKeychainUtils.o) > ld: symbol(s) not found for architecture armv6 > collect2: ld returned 1 exit status > > I'm not exactly sure what these errors mean, and what I need to do in the > obj-c binding to correct them. Could anyone provide some guidance and > suggestions? Would appreciate your comments. > ------------------------------ > View this message in context: Objective-C binding fails to compile for > iPhone > config<http://monotouch.2284126.n4.nabble.com/Objective-C-binding-fails-to-compile-for-iPhone-config-tp4255929p4255929.html> > Sent from the MonoTouch mailing list > archive<http://monotouch.2284126.n4.nabble.com/>at Nabble.com. > > _______________________________________________ > MonoTouch mailing list > [email protected] > http://lists.ximian.com/mailman/listinfo/monotouch > >
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
