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