Reputation: 28152
I'm getting "was built for newer version" warning when I build my project (see stack trace at bottom).
I'm sure it is the right version as I'm building it myself and I've checked with otool (https://stackoverflow.com/a/32382761/969325).
The setup is a C++ library build with xcode command tool (libA.a) this library is then included into an xcode project which build a static library (libWordprediction). From there it is included into my main iOS project.
Every time we build a binary file we will lipo them together to a fat binary in order to build for both simulator and device.
Now the setup works without any issues beside the warnings but I'd really like to be free of the warnings (and not just with -w option!)
Showing All Messages
Ld /Users/me/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Intermediates/myproject.build/Debug-iphoneos/myproject-da.build/Objects-normal/armv7/myproject-da normal armv7
cd /X/git/myproject-iOS
export IPHONEOS_DEPLOYMENT_TARGET=9.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk -L/Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Products/Debug-iphoneos -L/X/git/myproject-iOS/myproject/Resources/ReaderResources/Libraries -L/X/git/myproject-iOS/myproject/Resources/ReaderResources -L/x/Libraries -L/X/git/myproject-iOS/myproject/Module/OCRMODULE/MobileOCR/lib/combined -F/Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Products/Debug-iphoneos -F/X/git/myproject-iOS -F/X/git/myproject-iOS/Build -filelist /Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Intermediates/myproject.build/Debug-iphoneos/myproject-da.build/Objects-normal/armv7/myproject-da.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Intermediates/myproject.build/Debug-iphoneos/myproject-da.build/Objects-normal/armv7/myproject-da_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Intermediates/myproject.build/Debug-iphoneos/myproject-da.build/Objects-normal/armv7/myproject_da.swiftmodule -lxml2 -lstdc++ -lcrypto -lssl -lxml2 -lstdc++ -lcrypto -lssl -ObjC -lWordprediction -framework MVInAppPurchase -lMVSpeechSynthesizer -lAbbyyMsdk /Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Products/Debug-iphoneos/Alamofire.framework/Alamofire -framework Crashlytics -lxml2 -lsqlite3 -lz -lc++ -framework myprojectKeyboardTestable -framework SystemConfiguration -framework PSPDFKit -framework JavaScriptCore -framework OpenGLES -framework MobileCoreServices -framework myprojectAppleSpeechFramework -framework UIKit -framework GLKit -framework Accelerate -framework CoreTelephony -framework CFNetwork -framework CoreMedia -framework MVIDDeviceConnectorFramework -lcrypto -framework AVFoundation -framework Fabric -framework AudioToolbox -framework StoreKit -framework Security -framework UtilFramework -framework AssetsLibrary -framework CoreImage -framework ProfileFramework -lssl -framework CoreText -framework CoreData -framework CoreGraphics -framework Foundation -framework Social -framework ImageIO -framework MediaPlayer -framework myprojectServicesFramework -framework MessageUI -framework QuartzCore -framework QuickLook -framework GSS -Xlinker -dependency_info -Xlinker /Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Intermediates/myproject.build/Debug-iphoneos/myproject-da.build/Objects-normal/armv7/myproject-da_dependency_info.dat -o /Users/eg/Library/Developer/Xcode/DerivedData/myproject-ftdgvukparnrnsaefbeurzbnoxrp/Build/Intermediates/myproject.build/Debug-iphoneos/myproject-da.build/Objects-normal/armv7/myproject-da
ld: warning: directory not found for option '-F/X/git/myproject-iOS/Build'
ld: warning: object file (/x/Libraries/libWordprediction.a(c_regex_traits.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(chrono.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(codecvt_error_category.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(connection.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(cpp_regex_traits.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(cregex.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(date_generators.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(error_code.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(fileiter.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(future.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(graphml.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(greg_month.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(greg_weekday.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(icu.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(instances.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(named_slot_map.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(once.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(operations.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(path.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(path_traits.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(portability.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(posix_api.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(process_cpu_clocks.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(random_device.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(read_graphviz_new.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(regex.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(regex_debug.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(regex_raw_buffer.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(regex_traits_defaults.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(signal_base.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(slot.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(static_mutex.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(thread.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(thread_clock.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(trackable.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(unique_path.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(usinstances.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(utf8_codecvt_facet.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(w32_regex_traits.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(wc_regex_traits.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(wide_posix_api.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(windows_file_codecvt.o)) was built for newer iOS version (10.2) than being linked (9.0)
ld: warning: object file (/x/Libraries/libWordprediction.a(winstances.o)) was built for newer iOS version (10.2) than being linked (9.0)
Upvotes: 5
Views: 11434
Reputation: 28152
So my wrapper library used another library (boost) which were build for 10.2. This made my library build for higher version even though otool and xcode indicated something else and didn't give any errors when I build the library... Now I've stopped using the wrapper library (this is how I figured it out) and thereby cleaned up this mess as well.
Upvotes: 2
Reputation: 19602
You are building the libWordprediction
library for target OS 10.2
, but the app consuming the library targets OS 9
.
To fix this build libWordprediction
for target OS 9
too.
Upvotes: 3