xcode 6.x arm64 代码构建失败,没有任何编译或 link 错误
xcode 6.x arm64 code build failed without any compile or link error
我刚刚为我的项目启用了 arm64 支持。以下是构建设置(自项目启动以来仅 Bold/modified):
> Architectures:
Architectures: Standard Architectures (armv7, arm64) - $(ARCHS_STANDARD)
Base SDK: Latest iOS (iOS 8.3)
Build Active Architecture Only: NO
Supported Platforms: iOS
Valid Architectures: armv7 armv7s arm64
> Build Options
Validate Built Product: Yes
> Deployment
Strip Debug Symbols: Druing Copy: No
> Linking
Other Linker Flags: -lxml2 -lz -ObjC
> Packaging
Compress PNG Files: No
Info.plist File: <project_name>/Info.plist
Wrapper Extension: app
> Apple LLVM 6.1 - Code Generation
Generate Position-Dependent Code: No
Optimization Level: None [-O0]
> Apple LLVM 6.1 - Language
Precompile Prefix Header: Yes
Prefix Header: <project_name>/Prefix.pch
> Apple LLVM 6.1 - Preprocessing
Preprocessor Macros:
Debug: DEBUG COCOS2D_DEBUG=1 CC_TARGET_OS_IPHONE USE_FILE32API APP_TARGET=1 CC_ENABLE_CHIPMUNK_INTEGRATION
Distribution: NDEBUG USE_FILE32API CC_TARGET_OS_IPHONE APP_TARGET=1 CC_ENABLE_CHIPMUNK_INTEGRATION
Release: NDEBUG USE_FILE32API CC_TARGET_OS_IPHONE APP_TARGET=1 CC_ENABLE_CHIPMUNK_INTEGRATION
> Interface Builder NIB Postprocessor - Options
Strip NIB Files: No
我的项目使用的是 cocos2dx 2.2.6,以及 Chartboost、Apsalar、Flurry、Tapjoy 和 Fyber (Sponsor-Pay)。我还使用以下方法检查了我的静态库 (.a) 文件是否支持 64 位:
xcrun -sdk iphoneos lipo -info ./<project_path>/libs/cocos2dx/platform/third_party/ios/libraries/libwebp.a
Architectures in the fat file: ./<project_path>/libs/cocos2dx/platform/third_party/ios/libraries/libwebp.a are: i386 armv7 armv7s x86_64 arm64
我所有的静态库 (.a) 文件都显示 arm64,这意味着它们支持 64 位构建和打包。
现在,当我尝试构建我的代码时(都针对 simulator/device),xcode 显示在我的文件 compiling/building 之后构建最终失败。我在左窗格的 errors/warnings 部分没有发现 link/compile 时间错误。虽然它显示了一些代码警告,但代码中的警告在启用 arm64 支持之前就存在了。
多亏了我的哥们,我终于看到错误了。这是 XCode 中的某种错误。我执行了以下步骤:
- 设置仅构建活动架构:是
- 连接具有 arm64 架构和 OS(iPhone 6 plus)的设备
- 清理并构建
- 现在将向您显示错误
- 修复错误(尽管根据我的观察,这些错误以前在 32 位版本中不存在)
- 修复所有错误时设置仅构建活动架构:否
- 清理并构建
- 就是这样。完成
我希望这对其他人也有帮助。
我刚刚为我的项目启用了 arm64 支持。以下是构建设置(自项目启动以来仅 Bold/modified):
> Architectures:
Architectures: Standard Architectures (armv7, arm64) - $(ARCHS_STANDARD)
Base SDK: Latest iOS (iOS 8.3)
Build Active Architecture Only: NO
Supported Platforms: iOS
Valid Architectures: armv7 armv7s arm64
> Build Options
Validate Built Product: Yes
> Deployment
Strip Debug Symbols: Druing Copy: No
> Linking
Other Linker Flags: -lxml2 -lz -ObjC
> Packaging
Compress PNG Files: No
Info.plist File: <project_name>/Info.plist
Wrapper Extension: app
> Apple LLVM 6.1 - Code Generation
Generate Position-Dependent Code: No
Optimization Level: None [-O0]
> Apple LLVM 6.1 - Language
Precompile Prefix Header: Yes
Prefix Header: <project_name>/Prefix.pch
> Apple LLVM 6.1 - Preprocessing
Preprocessor Macros:
Debug: DEBUG COCOS2D_DEBUG=1 CC_TARGET_OS_IPHONE USE_FILE32API APP_TARGET=1 CC_ENABLE_CHIPMUNK_INTEGRATION
Distribution: NDEBUG USE_FILE32API CC_TARGET_OS_IPHONE APP_TARGET=1 CC_ENABLE_CHIPMUNK_INTEGRATION
Release: NDEBUG USE_FILE32API CC_TARGET_OS_IPHONE APP_TARGET=1 CC_ENABLE_CHIPMUNK_INTEGRATION
> Interface Builder NIB Postprocessor - Options
Strip NIB Files: No
我的项目使用的是 cocos2dx 2.2.6,以及 Chartboost、Apsalar、Flurry、Tapjoy 和 Fyber (Sponsor-Pay)。我还使用以下方法检查了我的静态库 (.a) 文件是否支持 64 位:
xcrun -sdk iphoneos lipo -info ./<project_path>/libs/cocos2dx/platform/third_party/ios/libraries/libwebp.a
Architectures in the fat file: ./<project_path>/libs/cocos2dx/platform/third_party/ios/libraries/libwebp.a are: i386 armv7 armv7s x86_64 arm64
我所有的静态库 (.a) 文件都显示 arm64,这意味着它们支持 64 位构建和打包。
现在,当我尝试构建我的代码时(都针对 simulator/device),xcode 显示在我的文件 compiling/building 之后构建最终失败。我在左窗格的 errors/warnings 部分没有发现 link/compile 时间错误。虽然它显示了一些代码警告,但代码中的警告在启用 arm64 支持之前就存在了。
多亏了我的哥们,我终于看到错误了。这是 XCode 中的某种错误。我执行了以下步骤:
- 设置仅构建活动架构:是
- 连接具有 arm64 架构和 OS(iPhone 6 plus)的设备
- 清理并构建
- 现在将向您显示错误
- 修复错误(尽管根据我的观察,这些错误以前在 32 位版本中不存在)
- 修复所有错误时设置仅构建活动架构:否
- 清理并构建
- 就是这样。完成
我希望这对其他人也有帮助。