ios - 升级到 Unity 4.6.1 后 Xcode 6.1.1 链接器错误 : entry point (_main) undefined. for architecture armv7

标签 ios xcode unity-game-engine

我正在尝试将我们的 Unity 项目从 4.5.4 升级到 4.6.1。

我可以像往常一样从 Unity 构建 Xcode 项目。但是,当我尝试从 Xcode 构建该项目时,我现在收到以下链接器错误:

ld: warning: directory not found for option '-F-filelist' ld: warning: ignoring file /Users/Eva/Library/Developer/Xcode/DerivedData/Unity-iPhone-dxcgletahzpcceadqwpribfbdgbg/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/supertestgame.LinkFileList, file was built for unsupported file format ( 0x2F 0x55 0x73 0x65 0x72 0x73 0x2F 0x45 0x76 0x61 0x2F 0x4C 0x69 0x62 0x72 0x61 ) which is not the architecture being linked (armv7): /Users/Eva/Library/Developer/Xcode/DerivedData/Unity-iPhone-dxcgletahzpcceadqwpribfbdgbg/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/supertestgame.LinkFileList ld: entry point (_main) undefined. for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

这是链接器传递的完整命令:

Ld /Users/Eva/Library/Developer/Xcode/DerivedData/Unity-iPhone-dxcgletahzpcceadqwpribfbdgbg/Build/Products/supertestgame.app/supertestgame normal armv7 cd /Users/Eva/Documents/bin/sps export IPHONEOS_DEPLOYMENT_TARGET=6.0 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/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/iPhoneOS8.1.sdk -L/Users/Eva/Library/Developer/Xcode/DerivedData/Unity-iPhone-dxcgletahzpcceadqwpribfbdgbg/Build/Products -L/Users/Eva/Documents/bin/sps/../../testgame_unity/Assets/Editor/Flurry/Ads -L/Users/Eva/Documents/bin/sps/../../testgame_unity/Assets/Editor/Flurry/Analytics -L/Users/Eva/Documents/bin/sps/../../testgame_unity/Assets/Editor/GameCenter -L/Users/Eva/Documents/bin/sps/../../testgame_unity/Assets/Editor/iCloud -L/Users/Eva/Documents/bin/sps/../../testgame_unity/Assets/Editor/Prime31Shared -L/Users/Eva/Documents/bin/sps/../../testgame_unity/Assets/Editor/SocialNetworking/Twitter -L/Users/Eva/Documents/bin/sps/../../testgame_unity/Assets/Editor/StoreKit -L/Users/Eva/Documents/bin/sps -L/Users/Eva/Documents/bin/sps/Libraries -F/Users/Eva/Library/Developer/Xcode/DerivedData/Unity-iPhone-dxcgletahzpcceadqwpribfbdgbg/Build/Products -F/Users/Eva/Documents/bin/sps/../../testgame_unity/Assets/Editor/SocialNetworking/FacebookSDK -F/Users/Eva/Documents/bin/sps/../../testgame_unity/Assets/Plugins/Everyplay/iOS -F -filelist /Users/Eva/Library/Developer/Xcode/DerivedData/Unity-iPhone-dxcgletahzpcceadqwpribfbdgbg/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/supertestgame.LinkFileList -dead_strip -weak_framework CoreMotion -weak-lSystem -all_load -ObjC -stdlib=libstdc++ -fobjc-link-runtime -miphoneos-version-min=6.0 -framework CoreText -framework Everyplay -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework OpenAL -liconv.2 -liPhone-lib -framework AudioToolbox -framework CFNetwork -framework MediaPlayer -framework CoreLocation -framework SystemConfiguration -weak_framework iAd -framework CoreMedia -framework CoreVideo -weak_framework AVFoundation -framework CoreGraphics -weak_framework CoreMotion -weak_framework GameKit -lFlurryAds -lFlurry -lGameCenterPlugin -lP31MonoBridge -liCloudPlugin -lP31SharedTools -framework FacebookSDK -lP31Twitter -lStoreKit -framework AssetsLibrary -weak_framework MessageUI -weak_framework AdSupport -framework CoreData -framework Security -weak_framework Accounts -weak_framework Social -weak_framework Twitter -weak_framework StoreKit -lz.1.1.3 -lz -lsqlite3.0 -Xlinker -dependency_info -Xlinker /Users/Eva/Library/Developer/Xcode/DerivedData/Unity-iPhone-dxcgletahzpcceadqwpribfbdgbg/Build/Intermediates/Unity-iPhone.build/Debug-iphoneos/Unity-iPhone.build/Objects-normal/armv7/supertestgame_dependency_info.dat -o /Users/Eva/Library/Developer/Xcode/DerivedData/Unity-iPhone-dxcgletahzpcceadqwpribfbdgbg/Build/Products/supertestgame.app/supertestgame

我在 Architectures 下的信息(在 XCode 中)如下所示:

Architectures: armv7 Base SDK: Latest iOS (iOS 8.1) Build Active Architecture Only: No Support Platforms: iphoneos Valid Architectures: arm64 armv7 armv7s

我想我首先需要知道的是,是什么生成了 *.LinkFileList?是 Unity 还是 XCode?

知道这个问题的原因是什么吗?

非常感谢!

最佳答案

好吧,在尝试了一天的一切之后,我偶然发现了这个修复程序。对第一个警告感到好奇(我假设它与我的问题无关):

ld: warning: directory not found for option '-F-filelist'

我打开了链接器详细信息(在链接器命令列表中添加了 -v)。我最后注意到了这一点:

-F/Users/Eva/Documents/bin/testgame/../../../Desktop/everyplay-ios-sdk-master -F/Users/Eva/Documents/bin/testgame/../../testgame_unity/Assets/Editor/SocialNetworking/FacebookSDK -F-filelist

事实证明,它对应于项目中 3 个框架搜索路径的列表,第 3 个是项目build设置中的 $(inherited)。因此,为了好玩,我删除了第 3 个条目,然后我的构建就完成了!

我不知道这样做会产生什么或是否会产生任何影响,但现在这就是我要做的。

关于ios - 升级到 Unity 4.6.1 后 Xcode 6.1.1 链接器错误 : entry point (_main) undefined. for architecture armv7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27831076/

相关文章:

javascript - 移动webkit内存消耗

iphone - 如何从其他标签推送标签栏中的其他 View ?

ios-deploy 无法在 Mac OS X El Capitan 10.11 上安装

c# - Unity 示例项目 "Roll a Ball"无法在 iPad 上运行(球不移动)?

ios - 确定 Unity 5 中系统音量是否静音

ios - 使用 NSString 以编程方式访问或创建 Objective-C 中的方法

ios - xcode 8.2 中显示 'RCTLogLevel' 错误的重新定义

iphone - UIImageView 边框颜色

ios - Swift 类添加 "@objc"为什么

ios - 在 iTunes Connect 中看不到我的构建