为什么我会得到:对象文件是为比链接版本更新的iOS版本构建的?

为什么我会得到:对象文件是为比链接版本更新的iOS版本构建的?,ios,xcode,Ios,Xcode,当我构建我的项目时,我收到了“为更新版本而构建”的警告(请参阅底部的堆栈跟踪) 我确信它是正确的版本,因为我自己正在构建它,并且我已经与otool()进行了检查 安装程序是用XCODE命令工具(LIBA .a)构建的C++库,然后将该库包含在构建静态库(LIbWordDebug)的XCODE项目中。从那时起,它就包含在我的主要iOS项目中 每次我们构建一个二进制文件时,我们都会将它们合并到一个胖二进制文件中,以便为模拟器和设备构建 现在,除了警告之外,安装工作没有任何问题,但我真的希望没有警告(

当我构建我的项目时,我收到了“为更新版本而构建”的警告(请参阅底部的堆栈跟踪)

我确信它是正确的版本,因为我自己正在构建它,并且我已经与otool()进行了检查

安装程序是用XCODE命令工具(LIBA .a)构建的C++库,然后将该库包含在构建静态库(LIbWordDebug)的XCODE项目中。从那时起,它就包含在我的主要iOS项目中

每次我们构建一个二进制文件时,我们都会将它们合并到一个胖二进制文件中,以便为模拟器和设备构建

现在,除了警告之外,安装工作没有任何问题,但我真的希望没有警告(并且仅使用-w选项!)


您正在为目标操作系统
10.2
构建
libWordprediction
库,但使用库的应用程序针对的是操作系统
9


为了修复目标操作系统
9
的此版本
libWordprediction

因此,我的包装器库使用了另一个为10.2构建的库(boost)。这使得我的库构建为更高版本,即使otool和xcode指示了其他内容,并且在构建库时没有给出任何错误。。。现在我已经停止使用包装器库(我就是这么想的),因此也清理了这堆乱七八糟的东西。

@shallowthough这是xcode 8,我已经尝试过了。另外,这是我自己构建的库…在我看来应该没有什么不同。
libWordprediction.a
是使用目标OS 10.2构建的,但是你的应用程序使用库的目标是OS9。我的库和我的项目都有Base SDK=最新的iOS(iOS 10.2)和iOS部署目标=9.0这正是我正在做的。我还通过使用otool测试了它的构建是否具有正确的目标(如我的问题中所述)。
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)