简体   繁体   中英

xcode 6.x arm64 code build failed without any compile or link error

I just enabled arm64 support for my project. Following are the build settings (only Bold/modified since the project started):

> 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

My project is using cocos2dx 2.2.6, with Chartboost, Apsalar, Flurry, Tapjoy, and Fyber (Sponsor-Pay). I have also checked my static libraries (.a) files for 64 bit suppport using:

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

All my static libs (.a) files are showing arm64 which means they support 64-bit build and packaging.

Now when I try to build my code (both for simulator/device), xcode shows build failed in the end after compiling/building my files. I got no link/compile time error in the errors/warnings section of left pane. Though it shows some code warnings but warnings in the code were present before enabling arm64 support.

Thanks to my buddy, I finally managed to see the errors. It's some kind of bug in XCode. I did the following steps:

  1. Set Build Active Architecture Only: Yes
  2. Connect a device which has arm64 architecture and OS (iPhone 6 plus)
  3. Clean & Build
  4. Now the errors will be shown to you
  5. Fix the errors (though in my observation these errors were not present before in 32 bit build)
  6. When you fix all the errors Set Build Active Architecture Only: No
  7. Clean & Build
  8. That's it. done

I hope this will help someone else too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM