Link fails for test but not app build
Link fails for test but not app build
- Subject: Link fails for test but not app build
- From: Rick Mann <email@hidden>
- Date: Tue, 02 Jul 2013 16:04:47 -0700
Bah, unit tests are a real pain.
Aside from many other issues, I have this problem. I define an inline function bool isNil(id o):
----------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#if __OBJC__
inline
bool
isNil(id inObj)
{
return inObj == nil || inObj == [NSNull null];
}
#endif
#ifdef __cplusplus
}
#endif
----------------------------------------------
This works fine in my app's build. But building the unit testing target, I get a link error:
(null): "_isNil", referenced from:
(null): -[UIImagePNGDataTransformer transformedValue:] in UIImagePNGDataTransformer.o
(null): -[NSManagedObject(LZ) copyAttributeValuesInto:] in NSManagedObject+LZ.o
(null): Symbol(s) not found for architecture i386
I've seen this kind of error before due to failing to inline, or name mangling. But the above code should not have that problem. Why does it work for my simulator and device builds, but not for the testing target?
The other problem I have is:
(null): "_OBJC_CLASS_$_SenTestCase", referenced from:
(null): _OBJC_CLASS_$_Tests in Tests.o
(null): "_OBJC_METACLASS_$_SenTestCase", referenced from:
(null): _OBJC_METACLASS_$_Tests in Tests.o
The Framework is part of the target. I even removed it and re-added it (which is a damn pain, because Xcode offers the wrong Framework in the frameworks list).
I'm under a looming deadline and don't have time for this. Does anyone know what might be going wrong?
--
Rick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden