gpt4 book ai didi

ios - XCode5 模拟器 : unknown option character `X' in: -Xlinker

转载 作者:可可西里 更新时间:2023-11-01 03:05:15 28 4
gpt4 key购买 nike

我目前被链接器错误阻止,该错误仅发生在 XCode5 上(XCode4 编译正常)并且仅发生在模拟器上(普通设备编译正常)。

当我尝试编译时,出现“Apple Mach-O Librarian Error”,它给出了以下文本墙:

Libtool build/DevOnly-iphonesimulator/libCozi\ Common\ Code.a normal i386 cd /Users/jr/ios/app/iCozi setenv IPHONEOS_DEPLOYMENT_TARGET 4.3 setenv PATH "/Applications/XCode5/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/XCode5/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/XCode5/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only i386 -syslibroot /Applications/XCode5/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/jr/ios/app/iCozi/build/DevOnly-iphonesimulator -L/Users/jr/ios/app/iCozi/../../ext/aiMatch/SASIA_iOS_SDK-iphonesimulator -L/Users/jr/ios/app/iCozi/../../ext/GoogleAdsSDK-iphone-v3.1/Library -L/Users/jr/ios/app/iCozi/../../ext/Google\ Analytics\ SDK/Library -L/Users/jr/ios/app/iCozi/../../ext/AdMarvel_iOS_SDK_2_9_1/AdMarvelSDK -L/Users/jr/ios/app/iCozi/../../ext/libComScore-1.1107.12 -L/Users/jr/ios/app/iCozi/../../ext/TestFlightSDK -L/Users/jr/ios/app/iCozi/../../ext/mBlox-SDK/Debug-universal -L/Users/jr/ios/app/iCozi/../../ext/mBlox-SDK/Release-universal -L/Users/jr/ios/app/iCozi/../../ext/FacebookSDK/FacebookSDK.framework/Versions/A -L/Users/jr/ios/app/iCozi/../../ext/GoogleConversionTrackingSDK -L/Users/jr/ios/app/iCozi/../../ext/TapjoyAdvertiserSDK/TapjoyAdvertiserLibrary -L/Users/jr/ios/app/iCozi/../../ext/MobileAppTracker.framework/Versions/A -filelist /Users/jr/ios/app/iCozi/build/iCozi.build/DevOnly-iphonesimulator/Cozi\ Common\ Code.build/Objects-normal/i386/Cozi\ Common\ Code.LinkFileList -all_load -ObjC -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/jr/ios/app/iCozi/build/iCozi.build/DevOnly-iphonesimulator/Cozi\ Common\ Code.build/Cozi\ Common\ Code.xcent -framework MobileAppTracker /Applications/XCode5/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/lib/libz.dylib -framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework Security -framework MobileCoreServices -framework CFNetwork -framework SystemConfiguration -weak_framework MessageUI -framework QuartzCore /Users/jr/ios/ext/three20/Build/Products/Release-iphonesimulator/libThree20.a /Users/jr/ios/ext/three20/Build/Products/Release-iphonesimulator/libThree20UI.a /Users/jr/ios/ext/three20/Build/Products/Release-iphonesimulator/libThree20UINavigator.a /Users/jr/ios/ext/three20/Build/Products/Release-iphonesimulator/libThree20UICommon.a /Users/jr/ios/ext/three20/Build/Products/Release-iphonesimulator/libThree20Style.a /Users/jr/ios/ext/three20/Build/Products/Release-iphonesimulator/libThree20Network.a /Users/jr/ios/ext/three20/Build/Products/Release-iphonesimulator/libThree20Core.a -framework CoreLocation -weak_framework MediaPlayer -weak_framework iAd -framework AVFoundation -framework AudioToolbox -lGoogleAnalytics /Applications/XCode5/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/lib/libsqlite3.0.dylib -weak_framework EventKit -weak_framework EventKitUI -lTestFlight -framework comScore -framework MDS-SDK-PhoneGap -lMDSCore -framework FacebookSDK -lGoogleConversionTracking /Users/jr/ios/ext/TapjoyAdvertiserSDK/TapjoyAdvertiserLibrary/TapjoyAdvertiserLibrary.a /Users/jr/ios/ext/FacebookSDK/FacebookSDK.framework/Versions/A/FacebookSDK /Users/jr/ios/ext/MobileAppTracker.framework/Versions/A/MobileAppTracker -o /Users/jr/ios/app/iCozi/build/DevOnly-iphonesimulator/libCozi\ Common\ Code.a

/Applications/XCode5/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `X' in: -Xlinker Usage: /Applications/XCode5/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] Usage: /Applications/XCode5/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] Command /Applications/XCode5/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1

问题的根源似乎是“未知的选项字符‘X’在:-Xlinker”,但谷歌并没有为该错误提供太多帮助:https://www.google.com/search?q=%22%60X%27+in%3A+Xlinker%22

"XLinker"在上面的困惑中出现了四次 (". . . -all_load -ObjC -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker/Users/jr/ios/app/iCozi/build/iCozi.build/DevOnly-iphonesimulator/Cozi\Common\Code.build/Cozi\Common\Code.xcent . . . ")

为了好玩,我尝试从“Cozi Common Code”目标名称中删除空格,但这没有帮助。

同样,这在 XCode4 模拟器上编译得很好,在 XCode5 中编译得很好,可以在物理设备上运行,包括 iPod 和 iPad,但是 XCode5 中的每个模拟器都有这个问题(iPhone/iPod/iPad,都正常和视网膜,在 iOS5/iOS6/iOS7 上)。

如果有人能帮助我查明真相,我将不胜感激。谢谢!

最佳答案

为了理解错误,您必须理解命令试图做什么。

在本例中,它使用了 Libtool,它是 libtool 的一个略微改动的版本。命令行中指定了一些选项,但我们要查找的是目标文件,这是作为 -o 选项传入的,参数是 /Users/jr/ios/app/iCozi/build/DevOnly-iphonesimulator/libCozi\Common\Code.a,以及我们正在生成的库类型,在本例中它是 -static。这两个选项一起明确说明您正在制作静态库存档。

因为您正在制作一个静态库存档,所以您实际做的唯一一件事就是将 .o 文件和可能的 .a 文件转换成另一个文件.a 文件。这可以大致等同于从一组文件 (.o) 和其他 .zip 的内容创建一个 .zip 文件> 文件 (.a)。在制作此存档时您可以做的事情很少,例如,您无法在构建静态存档时指定需要隐式链接的库,您无法指定您将需要权利。

libtool 提示是因为它不理解用于传入的静态库的选项。在这种情况下,选项是:

-Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/jr/ios/app/iCozi/build/iCozi.build/DevOnly-iphonesimulator/Cozi\ Common\ Code.build/Cozi\ Common\ Code.xcent

这些是当您尝试链接到权利文件时出现的选项,这意味着某些选项指定了权利文件的使用。在这种情况下,您自己找到了正确的解决方案,即删除 project settings -> Code Signing -> Code Signing Entitlements< 中指定的权利文件 -> DevOnly

关于ios - XCode5 模拟器 : unknown option character `X' in: -Xlinker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19693769/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com