IOS compilation undefined symbols error problem

Source: Internet
Author: User

Some of the most common causes are:

1 build without the framework

For example, there's a piece of code I used OpenGL to introduce a header file

#import <OpenGLES/ES2/glext.h>

Build, compile stage no problem, but link error undefined symbols for architecture xxx (here XXX may be armv7s,armv7 or arm64, depending on the configuration, will say later). The workaround is to add the opengles.framework to the build phases link Binary with libraries, and then compile on the OK

2 Engineering-dependent libraries, compile-time architectures mismatch

In build settings, the first architectures, which is the compilation architecture of the configuration project, consists of the following 3 configuration items:

Architectures: The arch that will be created by the bundle support

Valid architectures: Effective arch, this configuration is useless, generally configured as armv7,armv7s,arm64.

Build Active Architecture only: whether to hit only the arch of the current connected device

On the real machine, there are 3 common arch: armv7,armv7s,arm64

ARMV7: Corresponds to IPhone4 and iphone4s

armv7s: corresponding to IPhone5 and IPHONE5C, and the early ipad

ARM64/ARMV8: Corresponds to IPhone5S and IPhone6 series, and compare new ipad, such as ipad Mini2,ipad Air

Arch is backwards compatible, such as a armv7-out package that can be run on a arm64 architecture device; So if the app is going to support the IPhone4 series, architectures must include ARMV7.

The build Active Architecture only refers to whether the schema of only the currently connected devices is packaged. For example, architectures configuration armv7 and Arm64,build Active Architecture only set to Yes, then when the connection IPhone4, will be armv7 packaging; when connecting iphone5s, will be packaged in arm64. If build Active Architecture only is set to No, then all 2 architectures will be hit and executed at runtime based on the actual device architecture. So the final bundle will be larger than the volume

IOS compilation undefined symbols error problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.