Construyo una biblioteca estática que enlaza con otros marcos, particularmente CoreLocation. Quiero usar las funciones proporcionadas por iOS 5 pero ser compatible con 4.3.Biblioteca estática y -weak-lSystem
Mi accidente en el lanzamiento de aplicaciones cuando lo inicio en dispositivos iOS en 4.3 con este error:
Date/Time: 2012-08-22 16:44:53.900 +0200
OS Version: iPhone OS 4.3.3 (8J3)
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread: 0
Dyld Error Message:
Symbol not found: _UIKeyboardDidChangeFrameNotification
El problema que encuentro es descrito en este post: iOS 4 app crashes at startup on iOS 3.1.3: Symbol not found: __NSConcreteStackBlock.
Pero, ¿cómo lidiar con eso al construir una biblioteca estática? No puedo compilar cuando configuro el indicador -weak-lSystem. Aquí está una traza:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified, -all_load invalid
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -weak-lSystem
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -weak-lSystem is not an object file (not allowed in a library)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/libxml2.2.dylib is a dynamic library, not added to the static library
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/libxml2.2.dylib is a dynamic library, not added to the static library
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/libz.dylib is a dynamic library, not added to the static library
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/libz.dylib is a dynamic library, not added to the static library
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1
resuelve
Ver respuesta aceptada a continuación y no se olvide de marcar las bibliotecas utilizadas en diferentes versiones como opcional en Xcode. Por ejemplo, utilizo la notificación nueva de UIKit para iOS 5, pero mi objetivo de implementación es 4.3, por lo que debo marcar esta biblioteca como Opcional para que todo funcione. Es lo mismo para CoreLocation CLGeocoder nueva clase iOS 5.
Intenté vincular débilmente las librerías dinámicas, sin éxito. ¡También traté de añadir una bandera dinámica pero es incluso peor! – nverinaud